return begin;
}
- public void setBegin(int start)
- {
- this.begin = start;
- }
-
/**
* DOCUMENT ME!
*
return end;
}
- public void setEnd(int end)
- {
- this.end = end;
- }
-
/**
* DOCUMENT ME!
*
return type;
}
- public void setType(String type)
- {
- this.type = type;
- }
-
/**
* DOCUMENT ME!
*
return featureGroup;
}
- public void setFeatureGroup(String featureGroup)
- {
- this.featureGroup = featureGroup;
- }
-
public void addLink(String labelLink)
{
if (links == null)
assertEquals(sf1.hashCode(), sf2.hashCode());
// changing type breaks equals:
- String restores = sf2.getType();
- sf2.setType("Type");
- assertFalse(sf1.equals(sf2));
- sf2.setType(restores);
+ SequenceFeature sf3 = new SequenceFeature("type", "desc", 22, 33,
+ 12.5f, "group");
+ SequenceFeature sf4 = new SequenceFeature("Type", "desc", 22, 33,
+ 12.5f, "group");
+ assertFalse(sf3.equals(sf4));
// changing description breaks equals:
- restores = sf2.getDescription();
+ String restores = sf2.getDescription();
sf2.setDescription("Desc");
assertFalse(sf1.equals(sf2));
sf2.setDescription(restores);
// changing start position breaks equals:
int restorei = sf2.getBegin();
- sf2.setBegin(21);
+ sf2 = new SequenceFeature(sf2, 21, sf2.getEnd(), sf2.getFeatureGroup());
assertFalse(sf1.equals(sf2));
- sf2.setBegin(restorei);
+ sf2 = new SequenceFeature(sf2, restorei, sf2.getEnd(),
+ sf2.getFeatureGroup());
// changing end position breaks equals:
restorei = sf2.getEnd();
- sf2.setEnd(32);
+ sf2 = new SequenceFeature(sf2, sf2.getBegin(), 32,
+ sf2.getFeatureGroup());
assertFalse(sf1.equals(sf2));
- sf2.setEnd(restorei);
+ sf2 = new SequenceFeature(sf2, sf2.getBegin(), restorei,
+ sf2.getFeatureGroup());
// changing feature group breaks equals:
restores = sf2.getFeatureGroup();
- sf2.setFeatureGroup("Group");
+ sf2 = new SequenceFeature(sf2, sf2.getBegin(), sf2.getEnd(), "Group");
assertFalse(sf1.equals(sf2));
- sf2.setFeatureGroup(restores);
+ sf2 = new SequenceFeature(sf2, sf2.getBegin(), sf2.getEnd(), restores);
// changing ID breaks equals:
restores = (String) sf2.getValue("ID");
SequenceFeature sf = new SequenceFeature("type", "desc", 22, 33, 12.5f,
"group");
assertFalse(sf.isContactFeature());
- sf.setType("");
+ sf = new SequenceFeature("", "desc", 22, 33, 12.5f, "group");
assertFalse(sf.isContactFeature());
- sf.setType(null);
+ sf = new SequenceFeature(null, "desc", 22, 33, 12.5f, "group");
assertFalse(sf.isContactFeature());
- sf.setType("Disulfide Bond");
+ sf = new SequenceFeature("Disulfide Bond", "desc", 22, 33, 12.5f,
+ "group");
assertTrue(sf.isContactFeature());
- sf.setType("disulfide bond");
+ sf = new SequenceFeature("disulfide bond", "desc", 22, 33, 12.5f,
+ "group");
assertTrue(sf.isContactFeature());
- sf.setType("Disulphide Bond");
+ sf = new SequenceFeature("Disulphide Bond", "desc", 22, 33, 12.5f,
+ "group");
assertTrue(sf.isContactFeature());
- sf.setType("disulphide bond");
+ sf = new SequenceFeature("disulphide bond", "desc", 22, 33, 12.5f,
+ "group");
assertTrue(sf.isContactFeature());
}
}
20500, 0f, null);
assertFalse(testee.retainFeature(sf, accId));
- sf.setType("aberrant_processed_transcript");
+ sf = new SequenceFeature("aberrant_processed_transcript", "", 20000,
+ 20500, 0f, null);
assertFalse(testee.retainFeature(sf, accId));
- sf.setType("NMD_transcript_variant");
+ sf = new SequenceFeature("NMD_transcript_variant", "", 20000, 20500,
+ 0f, null);
assertFalse(testee.retainFeature(sf, accId));
// other feature with no parent is retained
- sf.setType("sequence_variant");
+ sf = new SequenceFeature("sequence_variant", "", 20000, 20500, 0f, null);
assertTrue(testee.retainFeature(sf, accId));
// other feature with desired parent is retained
assertTrue(testee.identifiesSequence(sf, accId));
// exon sub-type with right parent is valid
- sf.setType("coding_exon");
+ sf = new SequenceFeature("coding_exon", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertTrue(testee.identifiesSequence(sf, accId));
// transcript not valid:
- sf.setType("transcript");
+ sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
// CDS not valid:
- sf.setType("CDS");
+ sf = new SequenceFeature("CDS", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
}
null);
assertFalse(testee.retainFeature(sf, accId));
- sf.setType("CDS_predicted");
+ sf = new SequenceFeature("CDS_predicted", "", 20000, 20500, 0f, null);
assertFalse(testee.retainFeature(sf, accId));
// other feature with no parent is retained
- sf.setType("sequence_variant");
+ sf = new SequenceFeature("CDS_psequence_variantredicted", "", 20000,
+ 20500, 0f, null);
assertTrue(testee.retainFeature(sf, accId));
// other feature with desired parent is retained
assertTrue(testee.identifiesSequence(sf, accId));
// cds sub-type with right parent is valid
- sf.setType("CDS_predicted");
+ sf = new SequenceFeature("CDS_predicted", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertTrue(testee.identifiesSequence(sf, accId));
// transcript not valid:
- sf.setType("transcript");
+ sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
// exon not valid:
- sf.setType("exon");
+ sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
+ sf.setValue("Parent", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
}
sf.setValue("ID", "gene:" + geneId);
assertFalse(testee.retainFeature(sf, geneId));
- sf.setType("transcript");
+ sf = new SequenceFeature("transcript", "", 20000, 20500, 0f, null);
sf.setValue("Parent", "gene:" + geneId);
assertTrue(testee.retainFeature(sf, geneId));
- sf.setType("mature_transcript");
+ sf = new SequenceFeature("mature_transcript", "", 20000, 20500, 0f,
+ null);
sf.setValue("Parent", "gene:" + geneId);
assertTrue(testee.retainFeature(sf, geneId));
- sf.setType("NMD_transcript_variant");
+ sf = new SequenceFeature("NMD_transcript_variant", "", 20000, 20500,
+ 0f, null);
sf.setValue("Parent", "gene:" + geneId);
assertTrue(testee.retainFeature(sf, geneId));
sf.setValue("Parent", "gene:XYZ");
assertFalse(testee.retainFeature(sf, geneId));
- sf.setType("anything");
+ sf = new SequenceFeature("anything", "", 20000, 20500, 0f, null);
assertTrue(testee.retainFeature(sf, geneId));
}
assertTrue(testee.identifiesSequence(sf, accId));
// gene sub-type with right ID is valid
- sf.setType("snRNA_gene");
+ sf = new SequenceFeature("snRNA_gene", "", 1, 2, 0f, null);
+ sf.setValue("ID", "gene:" + accId);
assertTrue(testee.identifiesSequence(sf, accId));
// transcript not valid:
- sf.setType("transcript");
+ sf = new SequenceFeature("transcript", "", 1, 2, 0f, null);
+ sf.setValue("ID", "gene:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
// exon not valid:
- sf.setType("exon");
+ sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
+ sf.setValue("ID", "gene:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
}
20500, 0f, null);
assertFalse(testee.retainFeature(sf, accId));
- sf.setType("mature_transcript");
+ sf = new SequenceFeature("mature_transcript", "", 20000, 20500, 0f,
+ null);
assertFalse(testee.retainFeature(sf, accId));
- sf.setType("NMD_transcript_variant");
+ sf = new SequenceFeature("NMD_transcript_variant", "", 20000, 20500,
+ 0f, null);
assertFalse(testee.retainFeature(sf, accId));
// other feature with no parent is kept
- sf.setType("anything");
+ sf = new SequenceFeature("anything", "", 20000, 20500, 0f, null);
assertTrue(testee.retainFeature(sf, accId));
// other feature with correct parent is kept
assertTrue(testee.identifiesSequence(sf, accId));
// transcript sub-type with right ID is valid
- sf.setType("ncRNA");
+ sf = new SequenceFeature("ncRNA", "", 1, 2, 0f, null);
+ sf.setValue("ID", "transcript:" + accId);
assertTrue(testee.identifiesSequence(sf, accId));
// Ensembl treats NMD_transcript_variant as if a transcript
- sf.setType("NMD_transcript_variant");
+ sf = new SequenceFeature("NMD_transcript_variant", "", 1, 2, 0f, null);
+ sf.setValue("ID", "transcript:" + accId);
assertTrue(testee.identifiesSequence(sf, accId));
// gene not valid:
- sf.setType("gene");
+ sf = new SequenceFeature("gene", "", 1, 2, 0f, null);
+ sf.setValue("ID", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
// exon not valid:
- sf.setType("exon");
+ sf = new SequenceFeature("exon", "", 1, 2, 0f, null);
+ sf.setValue("ID", "transcript:" + accId);
assertFalse(testee.identifiesSequence(sf, accId));
}