-
Notifications
You must be signed in to change notification settings - Fork 0
/
smadann.py
43 lines (37 loc) · 1.25 KB
/
smadann.py
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
from __future__ import print_function
from dnapilib.apred import adapter_prediction
import argparse
def auto_detect(fasta_file):
adapter = adapter_prediction(fasta_file, 1.4, 9, 50000)
if adapter:
if adapter[0][1] == "TGGAATTCTCGGGTGCCAAGG":
return "illumina"
elif adapter[0][1] == "AACTGTAGGCACCATCAAT":
return "qiaseq"
elif adapter[0][1] == "AAAAAAAAA":
return "cats"
return protocol
parser = argparse.ArgumentParser()
parser.add_argument("--fa",
help="File with sequences.", required=True)
parser.add_argument("-o", "--out", default="spikeins.fa",
help="Name used for output files.")
args = parser.parse_args()
protocol = auto_detect(args.fa)
if protocol == "illumina":
clip_R1 = 0
three_prime_clip_R1 = 0
three_prime_adapter = "TGGAATTCTCGGGTGCCAAGG"
elif protocol == "nextflex":
clip_R1 = 4
three_prime_clip_R1 = 4
three_prime_adapter = "TGGAATTCTCGGGTGCCAAGG"
elif protocol == "qiaseq":
clip_R1 = 0
three_prime_clip_R1 = 0
three_prime_adapter = "AACTGTAGGCACCATCAAT"
elif protocol == "cats":
clip_R1 = 3
three_prime_clip_R1 = 0
# three_prime_adapter = "GATCGGAAGAGCACACGTCTG"
three_prime_adapter = "AAAAAAAA"