Skip to content

Commit

Permalink
Accept RefSeq accession numbers and remove plasmids
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-plessy committed Nov 20, 2024
1 parent b6c7fb3 commit b0c0c18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/local/filter.nf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ process FILTER {
# - does that assembly has sex chromosomes?
cut -c 1-2 ${prefix}.orig_bgzipped.fa.fai | sort | uniq -c | sort -n > ${prefix}.patterns.txt
# Keep only complete chromosomes but remove the mitogenome
# Keep only complete chromosomes but remove the mitogenome and plasmids
sed 's/^>//' ${prefix}.contignames.txt |
grep -vi mitochondri |
grep -vi -e mitochondri -e plasmid |
awk '{print \$1}' |
grep -E "^(CM|CP|FR|L[R-T]|O[U-Z])" > ${prefix}.contignames.chromosomes.txt ||
grep -E "^(CM|CP|FR|L[R-T]|NC|NZ|O[U-Z])" > ${prefix}.contignames.chromosomes.txt ||
true > /dev/null # Returns success even if list is empty.
samtools faidx -r ${prefix}.contignames.chromosomes.txt ${prefix}.orig_bgzipped.fa.gz | bgzip --threads $task.cpus --compress-level 9 > ${prefix}.chromosomes.fa.gz
Expand Down

0 comments on commit b0c0c18

Please sign in to comment.