import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
-import jalview.datamodel.GeneLoci;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
* verify variant feature(s) computed and added to protein
* first codon AGC varies to ACC giving S/T
*/
- SequenceI peptide = al.getSequenceAt(1)
- .getDBRefs()[0].getMap().getTo();
+ DBRefEntry[] dbRefs = al.getSequenceAt(1).getDBRefs();
+ SequenceI peptide = null;
+ for (DBRefEntry dbref : dbRefs)
+ {
+ if (dbref.getMap().getMap().getFromRatio() == 3)
+ {
+ peptide = dbref.getMap().getTo();
+ }
+ }
List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
assertEquals(proteinFeatures.size(), 1);
sf = proteinFeatures.get(0);
SequenceI gene1 = alignment.getSequenceAt(0);
int[] to = new int[] { 45051610, 45051634 };
int[] from = new int[] { gene1.getStart(), gene1.getEnd() };
- gene1.setGeneLoci(new GeneLoci("human", "GRCh38", "17", new MapList(
- from, to, 1, 1)));
+ gene1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1));
/*
* map 'transcript1' to chromosome via 'gene1'
to = new int[] { 45051612, 45051619, 45051624, 45051633 };
SequenceI transcript1 = alignment.getSequenceAt(1);
from = new int[] { transcript1.getStart(), transcript1.getEnd() };
- transcript1.setGeneLoci(new GeneLoci("human", "GRCh38", "17",
- new MapList(from, to, 1, 1)));
+ transcript1.setGeneLoci("human", "GRCh38", "17", new MapList(from, to,
+ 1, 1));
/*
* map gene2 to chromosome reverse strand
SequenceI gene2 = alignment.getSequenceAt(2);
to = new int[] { 45051634, 45051610 };
from = new int[] { gene2.getStart(), gene2.getEnd() };
- gene2.setGeneLoci(new GeneLoci("human", "GRCh38", "17", new MapList(
- from, to, 1, 1)));
+ gene2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to, 1, 1));
/*
* map 'transcript2' to chromosome via 'gene2'
to = new int[] { 45051633, 45051624, 45051619, 45051612 };
SequenceI transcript2 = alignment.getSequenceAt(3);
from = new int[] { transcript2.getStart(), transcript2.getEnd() };
- transcript2.setGeneLoci(new GeneLoci("human", "GRCh38", "17",
- new MapList(from, to, 1, 1)));
+ transcript2.setGeneLoci("human", "GRCh38", "17", new MapList(from, to,
+ 1, 1));
/*
* add a protein product as a DBRef on transcript1
* verify variant feature(s) computed and added to protein
* last codon GCT varies to GGT giving A/G in the last peptide position
*/
- SequenceI peptide = al.getSequenceAt(3).getDBRefs()[0].getMap().getTo();
+ DBRefEntry[] dbRefs = al.getSequenceAt(3).getDBRefs();
+ SequenceI peptide = null;
+ for (DBRefEntry dbref : dbRefs)
+ {
+ if (dbref.getMap().getMap().getFromRatio() == 3)
+ {
+ peptide = dbref.getMap().getTo();
+ }
+ }
List<SequenceFeature> proteinFeatures = peptide.getSequenceFeatures();
assertEquals(proteinFeatures.size(), 1);
sf = proteinFeatures.get(0);