This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Filter out ALT contigs from CRAM

Dear community members,

I got a CRAM aligned to a very customised reference with weird (not even "canonical" alt) contigs. They are not covered except several accidental reads and I can safely filter them out. Is there a way to do it for CRAM (I don't have this custom reference)? I know how to do it with BAM, but not sure if it will work with CRAM...

cram

I don't have this custom reference

I'm not sure you can do much things with a CRAM without reference...

1 answer

Perhaps you can create a dummy reference containing N's for the weird contigs (while matching the lengths).

Then use the valid sequences for the contigs you want to keep - if I read it correctly you have the main contigs - only the weird-ALTs are missing

then use that dummy reference to filter the CRAM file by the desired contigs.

this answer is the essence of bioinformatics - I am sure it will work but wow...

indeed bioinformatics is more about how to work around the endless foundational problems or as Brent Pedersen put it 10 years ago:

I've been doing bioinformatics for about 10 years now. I used to joke with a friend of mine that most of our work was converting between file formats. We don't joke about that anymore.

10+10, makes the sentiment 20 year old now, and still applies just as much

Very Bad Things

Log in to answer this question.