Ejemplo n.º 1
0
 def testSamePrefixDifferentSuffixThreeReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\nagttcctggtc\n>how\nagtcggtat'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (3, 0))
Ejemplo n.º 2
0
 def testDifferentPrefixSameSuffixThreeReads(self):
     seq = '>hey\nagtccttagatcg\n>you\ncgaatcg\n>how\natgacctcg'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (0, 3))
Ejemplo n.º 3
0
 def testTwoDifferentReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\ntcctg'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (0, 0))
Ejemplo n.º 4
0
 def testSamePrefixAndSuffixTwoReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\nagttcctggtc'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (3, 3))
Ejemplo n.º 5
0
 def testZeroInput(self):
     result = getPrefixAndSuffix(StringIO())
     self.assertEqual(result, (0, 0))
Ejemplo n.º 6
0
 def testOneInput(self):
     seq = '>hey\nagtcagtcagtc'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (12, 12))
Ejemplo n.º 7
0
 def testSamePrefixDifferentSuffixThreeReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\nagttcctggtc\n>how\nagtcggtat'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (3, 0))
Ejemplo n.º 8
0
 def testDifferentPrefixSameSuffixThreeReads(self):
     seq = '>hey\nagtccttagatcg\n>you\ncgaatcg\n>how\natgacctcg'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (0, 3))
Ejemplo n.º 9
0
 def testTwoDifferentReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\ntcctg'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (0, 0))
Ejemplo n.º 10
0
 def testSamePrefixAndSuffixTwoReads(self):
     seq = '>hey\nagtcagtcagtc\n>you\nagttcctggtc'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (3, 3))
Ejemplo n.º 11
0
 def testOneInput(self):
     seq = '>hey\nagtcagtcagtc'
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (12, 12))
Ejemplo n.º 12
0
 def testZeroInput(self):
     result = getPrefixAndSuffix(StringIO())
     self.assertEqual(result, (0, 0))
Ejemplo n.º 13
0
#!/usr/bin/env python

from Bio import SeqIO
from dark.analyze_reads import getPrefixAndSuffix
from dark.analyze_reads import trimReads
import sys


if len(sys.argv) != 2:
    print >> sys.stderr, "getPrefixAndSuffix() takes exactly 1 argument"
    sys.exit(1)

else:
    filename = sys.argv[1]
    prefix, suffix = getPrefixAndSuffix(filename)

    print >>sys.stderr, "Prefix length %d, suffix length %d" % (prefix, suffix)

    SeqIO.write(trimReads(prefix, suffix, filename), sys.stdout, 'fasta')
Ejemplo n.º 14
0
#!/usr/bin/env python

from __future__ import print_function

from Bio import SeqIO
from dark.analyze_reads import getPrefixAndSuffix
from dark.analyze_reads import trimReads
import sys


if len(sys.argv) != 2:
    print('getPrefixAndSuffix() takes exactly 1 argument', file=sys.stderr)
    sys.exit(1)

else:
    filename = sys.argv[1]
    prefix, suffix = getPrefixAndSuffix(filename)

    print('Prefix length %d, suffix length %d' % (prefix, suffix),
          file=sys.stderr)

    SeqIO.write(trimReads(prefix, suffix, filename), sys.stdout, 'fasta')
Ejemplo n.º 15
0
 def testSamePrefixSameSuffixThreeReads(self):
     seq = ">hey\nagtccttagatcg\n>you\nagtcgaatcg\n>how\nagtaacctcg"
     result = getPrefixAndSuffix(StringIO(seq))
     self.assertEqual(result, (3, 3))