Entering edit mode
4.2 years ago
eridanus
▴
40
Hello! I am trying to align multiple fastq files with a loop in Bash (with STAR commands). But it does not work. I think the problem is with --outFileNamePrefix command, but because I am a beginner I cannot fix it. I should note that the directory where the fastq files are saved is totally different than the directory that output files are saved, maybe is this the problem? Thank you so much!! My code is the following one:
for i in my_path/*.fastq;
do ./STAR --genomeDir /path_to_genindex/ \
--readFilesIn $i \
--outFilterType BySJout \
--outFilterMultimapNmax 20 \
--alignSJoverhangMin 8 \
--alignSJDBoverhangMin 1 \
--outFilterMismatchNmax 999 \
--outFilterMismatchNoverLmax 0.1 \
--alignIntronMin 20 \
--alignIntronMax 1000000 \
--alignMatesGapMax 1000000 \
--outSAMattributes NH HI NM MD \
--outSAMtype BAM SortedByCoordinate \
--quantMode GeneCounts \
--outFileNamePrefix /my_path/samples/${i%my_path/}
done
Pick apart the actual sample name from full file name. That then gives you the freedom to reconstruct new names as needed.
Try this:
Once you have the basic sample name use that to extend your loop with right set of options. Following is just an example.
you should learn how to use a workflow manager : snakemake, nextflow....