Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Created March 8, 2017 17:51
Show Gist options
  • Save terrycojones/777748959ba481f5752cda93d4ebe2f0 to your computer and use it in GitHub Desktop.
Save terrycojones/777748959ba481f5752cda93d4ebe2f0 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from __future__ import print_function
from dark.diamond.alignments import DiamondReadsAlignments
from dark.fasta import FastaReads
reads = FastaReads('reads.fasta')
readsAlignments = DiamondReadsAlignments(reads, ['out.json.bz2'])
for readAlignments in readsAlignments:
for alignment in readAlignments:
if alignment.subjectTitle.find('arvovirus') > -1:
print(readAlignments.read.toString('fasta'), end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment