Create fasta file for unbinned contigs

45 views
Skip to first unread message

Camila Lin

unread,
Aug 31, 2020, 4:31:43 PM8/31/20
to Anvi'o
Hi there,

I'm wondering if there's a way to write contigs that are not binned in any bins in a single fasta file? 

I tried `anvi-export-collection`, but only get a list of splits.

Thanks,
Camila

A. Murat Eren

unread,
Aug 31, 2020, 5:01:38 PM8/31/20
to Anvi'o
Hi Camila,

Sorry there is no straightforward way to get those sequences out. But it is possible. Try this:

anvi-export-collection -p PROFILE.db \
                       -C COLLECTION_NAME \
                       -O COLLECTION \
                        --include-unbinned

grep UNBINNED_ITEMS_BIN COLLECTION.txt | awk 'BEGIN{FS="_split_"}{print $1}' | sort | uniq > UNBINNED_CONTIG_NAMES.txt

anvi-export-contigs -c CONTIGS.db \
                    --contigs-of-interest UNBINNED_CONTIG_NAMES.txt \
                    -o UNBINNED_CONTIGS.fa

The FASTA File UNBINNED_CONTIGS.fa will contain all the contig sequences that were not binned in your collection COLLECTION_NAME.


Best,
--

A. Murat Eren (Meren) | he/him
http://merenlab.org :: twitter


--
Anvi'o Paper: https://peerj.com/articles/1319/
Project Page: http://merenlab.org/projects/anvio/
Code Repository: https://github.com/meren/anvio
---
You received this message because you are subscribed to the Google Groups "Anvi'o" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anvio+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/anvio/80e3dc4e-e8df-458b-93d5-29579f0c71d9n%40googlegroups.com.

Camila Lin

unread,
Sep 1, 2020, 3:26:44 PM9/1/20
to Anvi'o
Hi Meren,

Thank you for your reply.

I was able to generate the UNBINNED_CONTIG_NAMES.txt, however, anvi'o failed to write the fasta file. The error message I got was:

usage: anvi-export-contigs [-h] -c CONTIGS_DB [--splits-mode] -o FILE_PATH

                           [--version] [--debug] [--force]

anvi-export-contigs: error: unrecognized arguments: --contigs-of-interest


I was using Anvi'o 6.0 and 6.2, and I got the same error message. Seems like the command anvi-export-contigs doesn't have --contigs-of-interest flag. 


Thanks,


Camila


A. Murat Eren

unread,
Sep 1, 2020, 9:55:13 PM9/1/20
to Anvi'o
Sorry, Camila, I realized only after your e-mail that this is a feature that will be in the v7 (which will be released within the next month or two (fingers crossed)).

Until then you will need to consult your local bioinformatics guru :) Apologies for the inconvenience.


Best wishes,
--

A. Murat Eren (Meren) | he/him
http://merenlab.org :: twitter

Reply all
Reply to author
Forward
0 new messages