Skip to content

improvement: use wc to count bp instead of summing contig header info for abundance #124

Description

@franciscozorrilla

For abundance calculation we need to get bp of genome, currently we do this based on the contig headers info, although this can become problematic for genomes assembled by different tools (e.g. shovill renames them iirc). Replace this with a simple wc command to count bases in fasta

metaGEM/workflow/Snakefile

Lines 1118 to 1124 in a4daea0

# Check if bins are original (megahit-assembled) or strict/permissive (metaspades-assembled)
if [[ $bin == *.strict.fa ]] || [[ $bin == *.permissive.fa ]] || [[ $bin == *.s.fa ]] || [[ $bin == *.p.fa ]];then
less $bin |grep ">"|cut -d '_' -f4|awk '{{sum+=$1}}END{{print sum}}' >> $(echo "$bin"|sed "s/.fa/.map/")
else
less $bin |grep ">"|cut -d '-' -f4|sed 's/len_//g'|awk '{{sum+=$1}}END{{print sum}}' >> $(echo "$bin"|sed "s/.fa/.map/")
fi

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions