merenlab / MerenLab-workflows

A repository with scripts to run pipeline that are commonly used in the Meren Lab
GNU General Public License v3.0
11 stars 4 forks source link

storing num reads in metagenomes in samples.db #8

Open meren opened 7 years ago

meren commented 7 years ago

Currently we can get number of metagenomic reads the mapping software took into consideration the following way by parsing the logs:

for i in `ls *bowtie.log`
do
    echo -n "$i" | awk 'BEGIN{FS="-"}{printf("%s ", $2)}'
    grep 'reads; of these:' $i | awk '{print $1}'
done

It would have been very useful to have this in the resulting samples.db in the merged profile.

For this we need two things;

This will require some thinking and organization, but nothing myself, @ozcan, and @ShaiberAlon can't figure out :)

ShaiberAlon commented 6 years ago

@meren, it looks to me like this should be in issue in anvio and not in MerenLab-workflows.

For now, we can generate the table using logs the way you mentioned (only thing is, I'm not sure if snakemake would allow us to use the log from one rule as an input for another rule). Obviously using logs as input for a rule is ugly. Since we run QC on all metagenomes, and since I generate the table of stats for the metagenomes, we could use that output to get the number of reads in the metagenome. I'm confused by your wording: "number of metagenomic reads the mapping software took into consideration", what is the difference between that number and the total number of reads in the metagenome?

meren commented 6 years ago

We could learn the numbers from the QC step, but we do not necessarily QC every metagenomes. Therefore the most reliable source is the mapping software, i.e., how many reads the mapping software considered.

Does this make sense?