Skip to content

Commit 6ff63b8

Browse files
Fixing some previous errors with parsing and implemented Gene Ranges for mutation searching algorithms
1 parent 16894c3 commit 6ff63b8

File tree

9 files changed

+1601
-10
lines changed

9 files changed

+1601
-10
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ This program will implement the Cytogenic Location organization technique which
1515
### CTFR (cystic fibrosis transmembrane conductance regulator)
1616

1717
FIRST GENE USABLE IN PROGRAM. Located at 7q31.2. https://ghr.nlm.nih.gov/gene/CFTR#location
18+
19+
### AAAS(aladin WD repeat nucleoporin)
20+
21+
Located at 12q13.13. https://ghr.nlm.nih.gov/gene/AAAS#

resources/GeneDatabaseInformation/AAAS.fasta

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ q,
33
1,
44
3,
55
13,
6+
122073544,
7+
122144269,
68
TGAGTGGAAAACAAAAGGAAAACTTATTTATTCTTAGAGGTGGGAATGTGGGGAGTGGGGCAGAACAGGT
79
GGTGGCCCTGGGAGAGGGTCCCAAGGGGCAGAGGTTGGGGATGTCTCAGTAAAGAGGGGCAGGTCATGAA
810
TAGAGCCTCCACCCCCAGCAGGGGGTTCCTGGGCCCGCCCAAGCACTGGGCTAAAACGTGGAAACTGGGC

resources/GeneDatabaseInformation/ABAT.fasta

Lines changed: 1574 additions & 0 deletions
Large diffs are not rendered by default.

resources/GeneDatabaseInformation/CTFR.fasta

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ q,
33
3,
44
1,
55
2,
6+
117479963,
7+
117668665,
68
AATTGGAAGCAAATGACATCACAGCAGGTCAGAGAAAAAGGGTTGAGCGGCAGGCACCCAGAGTAGTAGG
79
TCTTTGGCATTAGGAGCTTGAGCCCAGACGGCCCTAGCAGGGACCCCAGCGCCCGAGAGACCATGCAGAG
810
GTCGCCTCTGGAAAAGGCCAGCGTTGTCTCCAAACTTTTTTTCAGGTGAGAAGGTGGCCAACCGAGCTTC

src/bin/main/Gene_Main/Gene.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,22 @@ public Gene(String sequence, GeneCytogenicLocation loc) {
3737
public Gene(String sequence) {
3838
String[] parsed_sequence = sequence.split(",");
3939
try {
40-
GeneCreation.check_if_Possible(parsed_sequence[5].toCharArray());
40+
GeneCreation.check_if_Possible(parsed_sequence[7].toCharArray());
4141
} catch (GeneCreationError e) {
4242
e.printStackTrace();
4343
return;
4444
}
4545
try {
4646
this.loc = new GeneCytogenicLocation(Integer.valueOf(parsed_sequence[0]), parsed_sequence[1].charAt(0),
47-
Integer.valueOf(parsed_sequence[2]), Integer.valueOf(parsed_sequence[3]), Integer.valueOf(parsed_sequence[4]));
47+
Integer.valueOf(parsed_sequence[2]), Integer.valueOf(parsed_sequence[3]), Integer.valueOf(parsed_sequence[4]),
48+
Integer.valueOf(parsed_sequence[5]), Integer.valueOf(parsed_sequence[6]));
4849
//System.out.println(this.loc);
4950
}catch(GeneCreationError e){
5051
e.printStackTrace();
5152
}catch (GenomeDatabaseError e){
5253
e.printStackTrace();
5354
}
54-
this.gene_information = parsed_sequence[5].toCharArray();
55+
this.gene_information = parsed_sequence[7].toCharArray();
5556
}
5657

5758

src/bin/main/Gene_Main/GeneCytogenicLocation.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,44 @@ public class GeneCytogenicLocation {
1616
private int region;
1717
private int band;
1818
private int sub_band;
19+
private int start;
20+
private int stop;
1921

20-
public GeneCytogenicLocation(int chromosome, char arm, int region, int band) throws GeneCreationError, GenomeDatabaseError {
22+
public GeneCytogenicLocation(int chromosome, char arm, int region, int band, int start, int stop) throws GeneCreationError, GenomeDatabaseError {
2123
if (chromosome < 1 || chromosome > 23)
2224
throw new GeneCreationError(GENEERROR.INVALID_CHROMOSOME);
2325
if (arm != 'p' && arm != 'q')
2426
throw new GeneCreationError(GENEERROR.INVALID_ARM);
2527
if (!GenomeRanges.singleDigit(region) || !GenomeRanges.singleDigit(band))
2628
throw new GenomeDatabaseError(GenomeError.INVALID_NUMBER_LENGTH);
27-
Location(chromosome, arm, region, band, 0);
29+
Location(chromosome, arm, region, band, 0, start, stop);
2830
}
2931

30-
public GeneCytogenicLocation(int chromosome, char arm, int region, int band, int sub_band) throws GeneCreationError, GenomeDatabaseError {
32+
public GeneCytogenicLocation(int chromosome, char arm, int region, int band, int sub_band, int start, int stop) throws GeneCreationError, GenomeDatabaseError {
3133
if (chromosome < 1 || chromosome > 23)
3234
throw new GeneCreationError(GENEERROR.INVALID_CHROMOSOME);
3335
if (arm != 'p' && arm != 'q')
3436
throw new GeneCreationError(GENEERROR.INVALID_ARM);
3537
if (!GenomeRanges.singleDigit(region) || !GenomeRanges.singleDigit(band) || !GenomeRanges.singleDigit(sub_band))
3638
throw new GenomeDatabaseError(GenomeError.INVALID_NUMBER_LENGTH);
3739

38-
Location(chromosome, arm, region, band, sub_band);
40+
Location(chromosome, arm, region, band, sub_band, start, stop);
3941
}
4042

41-
private void Location(int chromosome, char arm, int region, int band, int sub_band){
43+
private void Location(int chromosome, char arm, int region, int band, int sub_band, int start, int stop){
4244
this.chromosome = chromosome;
4345
this.arm = arm;
4446
this.region = region;
4547
this.band = band;
4648
this.sub_band = sub_band;
49+
this.start = start;
50+
this.stop = stop;
4751
}
4852

4953
@Override
5054
public String toString(){
5155
return "" + chromosome + arm + region + band + "." + sub_band;
5256
}
57+
58+
public String getRange() {return "("+ this.start + "-" + this.stop+")";}
5359
}

src/bin/main/Gene_Main/GeneDatabase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ public static void LoadDatabase() throws IOException, GeneCreationError {
2929

3030
public static String printDatabase(){
3131
for(String s: geneDatabase.keySet()){
32-
System.out.printf("Gene_Name:%s\t%s\n\t%s\n", s,geneDatabase.get(s).getCytogenicLocation().toString(), geneDatabase.get(s));
32+
System.out.printf("Gene_Name:%s\t%s\tRange:%s\n\t%s\n", s,geneDatabase.get(s).getCytogenicLocation().toString(), geneDatabase.get(s).getCytogenicLocation().getRange()
33+
, geneDatabase.get(s));
3334
}
3435
return "";
3536
}

src/bin/main/GenomeDatabaseInformation/GenomeDatabaseMain.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class GenomeDatabaseMain {
1919
National Center for Biotechnology Information
2020
*/
2121
public static void LoadDatabase() {
22+
//TODO FIX LOADING
2223
try {
2324
BufferedReader bf = new BufferedReader(new FileReader("resources/GenomeRanges"));
2425
String string;

src/bin/main/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void main(String[] args) {
3030
3131
j.setVisible(true);*/
3232

33-
GenomeDatabaseMain.LoadDatabase();
33+
//GenomeDatabaseMain.LoadDatabase();
3434

3535
//Gene g = new Gene("RACTA");
3636

0 commit comments

Comments
 (0)