Skip to content

Commit

Permalink
bugfix: pointer errors to reference files in endMask.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Schon committed Aug 22, 2018
1 parent 81a986f commit b70b743
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions endMask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ then
fi
if [ -z "$transcript_fasta" ]
then
transcript_fasta=$resource_dir/transcript.fasta
transcript_fasta=$resource_dir/transcriptome.fasta
fi
if [ -z "$LMOD" ]
then
Expand All @@ -111,22 +111,9 @@ then
output_folder=$results_dir/EndMask
fi

############################
# READING THE COMMAND LINE #
############################
# Taking the default variables above, modifying them with the commandline
# arguments (see read_cmdline.sh), and writing a config file

. $bash_dir/read_cmdline.sh

echo "###############"
echo "### ENDMASK ###"
echo "###############"
echo " "
echo "Config settings:"
. $bash_dir/list_settings.sh


# Environment modules to load with Lmod (if option --lmod is passed)
REQUIRED_MODULES=( --bedtools )
. $bash_dir/load_modules.sh
Expand All @@ -153,16 +140,14 @@ samples=( $(echo "${picked_from_table[@]}" | tr [:blank:] \\n | sort -u) )
length_table=$resource_dir/length.table
mask=$python_dir/bedgraph_mask.py
coverage=$python_dir/bed_feature_coverage.py
output_folder=$results_dir/EndMask
data_folder=$output_folder/$SAMPLE_NAME
data_folder=$output_folder/$SAMPLE_TYPE

rm -rf $data_folder
mkdir -p $data_folder
cd $data_folder

samples=($sample_list)
echo "Samples: ${samples[@]}"
echo "Sample type: $SAMPLE_NAME"
echo "Sample type: $SAMPLE_TYPE"

###########################
# CALCULATE READ COVERAGE #
Expand All @@ -186,7 +171,6 @@ python $python_dir/bedgraph_dominant_transcripts.py \
rm $SAMPLE_NAME.all.transcript.bedgraph $SAMPLE_NAME.dom.transcript.bedgraph

echo "Making gene-level bed files..."
bedgraph_list=()
for s in ${samples[@]}
do
# Perform cap masking on all 5' end bedgraphs (genome level)
Expand All @@ -206,15 +190,8 @@ do
--output $s.transcript.capmasked.bedgraph \
$data_folder/$s.capmask.plus.bedgraph \
$data_folder/$s.capmask.minus.bedgraph \
$annotation_gff \
$genome_fasta
$ANNOTATION_GFF \
$GENOME_FASTA

# Remove intermediate files
rm $s.transcript.capmasked.bedgraph
bedgraph_list+=( $s.transcript.bedgraph )
done
python $python_dir/bedgraph_combine.py \
-i ${bedgraph_list[@]} \
-o $SAMPLE_NAME.transcript.bedgraph


echo "EndMask complete! See results in results/EndMask/$SAMPLE_TYPE"

0 comments on commit b70b743

Please sign in to comment.