forked from mcgml/PrimerDesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMutationSurveyorReference.java
61 lines (52 loc) · 2.56 KB
/
MutationSurveyorReference.java
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
package nhs.genetics.cardiff;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Class for creating mutation surveyor reference files with 'pink bars' around target
*
* @author Matt Lyon
* @version 1.0
* @since 2015-04-20
*/
//todo
public class MutationSurveyorReference {
private static final Logger log = Logger.getLogger(MutationSurveyorReference.class.getName());
private GenomicLocation roi;
private ReferenceSequence paddedSequence;
private int paddding;
public MutationSurveyorReference(GenomicLocation roi, ReferenceSequence paddedSequence, int padding){
this.roi = roi;
this.paddedSequence = paddedSequence;
this.paddding = padding;
}
public void writeMutationSurveyorSeqFile(){
try(PrintWriter printWriter = new PrintWriter(roi.getContig() + "_" + roi.getStartPosition() + "_" + roi.getEndPosition() + ".seq")){
printWriter.println("/Gene = \"GRCh37:" + roi.getContig() + ":" + roi.getStartPosition() + "-" + roi.getEndPosition() + "\";");
printWriter.println("/Exon_And_Note = \"\";");
printWriter.println("/Reading Frame (1,2,3) = 1;");
printWriter.println("/transl_table = ;");
printWriter.println("/Remainder_Bases_of_the_Last_Exon = \"\";");
printWriter.println("/Remainder_Bases_of_the_Next_Exon = \"\";");
printWriter.println("/Number_of_the_First_Base = " + (roi.getStartPosition() - paddding) + ";");
printWriter.println("/CDS = 0..0;");
printWriter.println("/mCDSIndex = 1;");
printWriter.println("/isLastmRNA = 0;");
printWriter.println("/Exon_Base_Number = ;");
printWriter.println("/mRNAIndex = ;");
printWriter.println("/mRNARegion = ..;");
printWriter.println("/Region of Interest = " + roi.getStartPosition() + ".." + roi.getEndPosition() + ";");
printWriter.println("/Amplicon Id = \"\";");
printWriter.println("/Amino Acid Sequence = ..;");
printWriter.println("/Starting_vector_sequence = \"\";");
printWriter.println("/Ending_vector_sequence = \"\";");
printWriter.println("/NewVariation = \"\";");
printWriter.println("/Translation = \"\";");
printWriter.println((roi.getStartPosition() - paddding) + " " + paddedSequence.getReferenceSequence());
printWriter.close();
} catch (IOException e){
log.log(Level.SEVERE, e.toString());
}
}
}