panacheextract 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/panacheextract.rb +26 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13c2aba9cc2b3cf40fd1f6985665dc69b32575cb21089b4efb2ea498a86ed89d
|
4
|
+
data.tar.gz: bd6372a9715899cce3173320de7f6fbd6f2ed7292cc583eae0a1fdcae43bf5a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f290b6ec359eaaf6450a127113fc2a6b7cc099d03e26fe27a485277faa96349d600a2f714f7657c9a7f87cf20d2a2b3277c9ebcc5f81527dc7e38d36ad29dcf
|
7
|
+
data.tar.gz: 07af17b4f13ea4d620e7b22dc50c9811dc9d4411463156c60c91ea20172153a364b29e512053851ff768342316d0d082e5183b06863f012cb751808d68aa6d76
|
data/lib/panacheextract.rb
CHANGED
@@ -90,3 +90,29 @@ def getspecific(ids, inputalignment, outalignmentfile, del = "None")
|
|
90
90
|
return(delselect)
|
91
91
|
end
|
92
92
|
end
|
93
|
+
|
94
|
+
def delcoordinates(ids, inputalignment, outalignment)
|
95
|
+
id = ids.to_s
|
96
|
+
readiter = File.open(inputalignment, "r").readlines
|
97
|
+
writefile = File.new(outalignment, "w")
|
98
|
+
for i in 0..readiter.length
|
99
|
+
writefile.write(readiter[i]) if readiter[i].to_s.strip.split[0] == "s"
|
100
|
+
end
|
101
|
+
writefile.close
|
102
|
+
readopen = File.open(outalignment, "r").readlines
|
103
|
+
ids = []
|
104
|
+
sequences = []
|
105
|
+
ids_start = []
|
106
|
+
ids_end = []
|
107
|
+
for i in 0..readopen.length
|
108
|
+
readopen.each { | iter | ids.push(iter.to_s.strip.split[1]) if iter.to_s.strip.split[1] == id }
|
109
|
+
readopen.each { | iter | sequences.push(iter.to_s.strip.split[6]) if iter.to_s.strip.split[1] == id }
|
110
|
+
readopen.each { | iter | ids_start.push(iter.to_s.strip.split[2]) if iter.to_s.strip.split[1] == id }
|
111
|
+
readopen.each { | iter | ids_end.push(iter.to_s.strip.split[5]) if iter.to_s.strip.split[1] == id }
|
112
|
+
end
|
113
|
+
delselected = []
|
114
|
+
for i in 0..sequences.length
|
115
|
+
delselected.push([ids_start[i], ids_end[i]]) if sequences[i].to_s.count("-") >=1
|
116
|
+
end
|
117
|
+
return(delselected)
|
118
|
+
end
|