package com.cbrc.pipeline2;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Test {
String foldIn;
String fnmFasta;
String foldOut;
String fnmOut;
void init(String rootIn, String rootOut, String fnmInFasta, String fOut) {
this.foldIn = rootIn;
this.fnmFasta = this.foldIn + fnmInFasta;
this.foldOut = rootOut;
this.foldOut = this.foldOut + fOut;
}
void loadFasta(){
try {
FileInputStream fstream = new FileInputStream(fnmFasta);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String befTrim , strLine;
while ((befTrim = br.readLine()) != null) {
strLine = befTrim.trim();
}
br.close();
in.close();
fstream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
void writeSelectedRegion(){
try {
BufferedWriter bwr = new BufferedWriter(new FileWriter(this.fnmOut));
StringBuffer buf = new StringBuffer();
bwr.write(buf+"");
bwr.close();
} catch (Exception e) {
e.printStackTrace();
}
}
void doProcessing() {
loadFasta();
writeSelectedRegion();
}
public static void main(String[] args) {
Test obj = new Test();
obj.init(args[0], args[1] , args[2] , args[3]);
// obj.init("./", "test.fa", "20", "72" , "seq.prf");
obj.doProcessing();
}
}
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.InputStreamReader;
public class Test {
String foldIn;
String fnmFasta;
String foldOut;
String fnmOut;
void init(String rootIn, String rootOut, String fnmInFasta, String fOut) {
this.foldIn = rootIn;
this.fnmFasta = this.foldIn + fnmInFasta;
this.foldOut = rootOut;
this.foldOut = this.foldOut + fOut;
}
void loadFasta(){
try {
FileInputStream fstream = new FileInputStream(fnmFasta);
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String befTrim , strLine;
while ((befTrim = br.readLine()) != null) {
strLine = befTrim.trim();
}
br.close();
in.close();
fstream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
void writeSelectedRegion(){
try {
BufferedWriter bwr = new BufferedWriter(new FileWriter(this.fnmOut));
StringBuffer buf = new StringBuffer();
bwr.write(buf+"");
bwr.close();
} catch (Exception e) {
e.printStackTrace();
}
}
void doProcessing() {
loadFasta();
writeSelectedRegion();
}
public static void main(String[] args) {
Test obj = new Test();
obj.init(args[0], args[1] , args[2] , args[3]);
// obj.init("./", "test.fa", "20", "72" , "seq.prf");
obj.doProcessing();
}
}
Comments
Post a Comment