-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathORF_Testing.java
More file actions
72 lines (50 loc) · 1.46 KB
/
Copy pathORF_Testing.java
File metadata and controls
72 lines (50 loc) · 1.46 KB
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
68
69
70
package bioinformatics;
/*
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
*/
public class ORF_Testing {/*
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader( new FileReader( args[0]));
ORF_Testing orf_testing = new ORF_Testing();
String lines ;
while( (lines = br.readLine()) != null ) {
if ( lines.startsWith(">")) {
continue ;
}
else {
orf_testing.ORF(lines);
}
}br.close();
} */
public String ORF(String lines) {
String seq = lines;
/*
if ( seq.indexOf("ATG") != -1 )
{
System.out.println(seq.indexOf("ATG"));
System.out.println("Start codon found");
}
if ( seq.indexOf("TAA") != -1 )
{
System.out.println(seq.indexOf("TAA"));
System.out.println("Stop codon found");
}
*/
if ( seq.indexOf("ATG") != -1 && seq.indexOf("TAA") != -1 ) {
int start = seq.indexOf("ATG");
int stop = seq.indexOf("TAA");
System.out.println(seq.indexOf("ATG"));
System.out.println("Start codon found");
System.out.println(seq.indexOf("TAA"));
System.out.println("Stop codon found");
if ( stop > start ) {
String orf_sequence = seq.substring(start + 3, stop);
System.out.println("ORF Seq: " + orf_sequence);
System.out.println("");
}
}
return "";
}
}