Entering edit mode
4.3 years ago
Bioinfonext
▴
470
Hi,
I have got multiple sam files, could anyone please suggest a loop to get the total read count in pair, total mapped read count in pair and total unmapped read count in pair in a tab-delimited file with a file name.
sam file name is like this:
Leaf_T3_S_R2_S45_L001.sam
Leaf_T3_F_R9_S12_L001.sam
Root_T3_F_R7_S29_L001.sam
Many thanks
you are asking two questions: a) how to loop over files b) how to extract mapped counts. a) is not really a topic for this site and you can find answers on stackoverflow or google. b) was answered multiple times.
Use
samtools idsxtats
.Hi genomax,
I have converted sam files to bam and I am trying to use below commnad for getting total unmapped reads number by using reformat.sh from bbtools but it is not giving any output (empty files) ? could you please suggest what is the error?
Thanks
There are no
-
in front of BBTools options. Justin=
. I am not sure that redirector will work. Will have to check.thanks genomax,
this command is working perfectly;
but as you said redirection is not working!
Many thanks
You could use a
#SBATCH -e file.err
in your script, which will collect the stats output for all three jobs infile.err
, via SLURM log. You will need to parse out the individual results afterwards.