File: test_seqtk_trinity.py

package info (click to toggle)
trinityrnaseq 2.11.0%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 417,528 kB
  • sloc: perl: 48,420; cpp: 17,749; java: 12,695; python: 3,124; sh: 1,030; ansic: 983; makefile: 688; xml: 62
file content (67 lines) | stat: -rw-r--r-- 1,424 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env python

import subprocess

def run_trinity_seqtk(inputfile, readdir):

    cmd = "../seqtk-trinity seq -A -R {} {} > /dev/null".format(readdir, inputfile)

    return subprocess.run(cmd, shell=True, check=False).returncode


## old format: @61DFRAAXX100204:1:100:10494:3070/1

def test_oldformat_1_success():
    ret = run_trinity_seqtk("oldformat_1.fq", 1)
    assert(ret==0)


def test_oldformat_1_failure():
    ret = run_trinity_seqtk("oldformat_1.fq", 2)
    assert(ret==2)


def test_oldformat_2_success():
    ret = run_trinity_seqtk("oldformat_2.fq", 2)
    assert(ret==0)


def test_oldformat_2_failure():
    ret = run_trinity_seqtk("oldformat_2.fq", 1)
    assert(ret==2)


## new format:  @M01581:927:000000000-ARTAL:1:1101:19874:2078 1:N:0:1

def test_newformat_1_success():
    ret = run_trinity_seqtk("newformat_1.fq", 1)
    assert(ret==0)


def test_newformat_1_failure():
    ret = run_trinity_seqtk("newformat_1.fq", 2)
    assert(ret==2)


    
def test_newformat_2_success():
    ret = run_trinity_seqtk("newformat_2.fq", 2)
    assert(ret==0)


def test_newformat_2_failure():
    ret = run_trinity_seqtk("newformat_2.fq", 1)
    assert(ret==2)

    
## corrupt format tests

def test_corrupt_fastq():
    ret = run_trinity_seqtk("corrupt_1.fq", 1)
    assert(ret==4)

def test_unequal_seq_n_quals_fastq():
    ret = run_trinity_seqtk("unequal_seq_n_quals_1.fq", 1)
    assert(ret==3)