1/ create a new transcript just aside an existing one.
So we have a temp transcript (Tt) and an existing
transcript (Te).
2/Merge the two transcript and keep the name of the
existing transcript. It is a way for a user to add
exons to a transcript by extending it's range.
3/Commit to chado and boom.
The problem was that if the exons are moved to the new
transcript and that the user wants to keep the old
name, apollo tries to delete the old and transfer its
information to the new one. First problem, apollo gets
mad on this process. Second problem, we delete an
existing gene while the user likely will was simply to
extend the existing one.
To correct this, I propose a modification of
AnnotationEditor which ensure in this case that the
annotations are moved to the existing gene.
------------------------------------
private void mergeTranscripts(Vector transcripts) {
Transcript tran1 = (Transcript)transcripts.elementAt(0);
Transcript tran2 = (Transcript)transcripts.elementAt(1);
// if we merge transcripts then we have to check
that any other
// overlapping transcripts are also pulled into the
same gene
// NOTE: This is now done in consolidateGenes.
System.out.println ("\n\t****** MERGING TRANSCRIPTS
******");
/* moveExonsToTrans is the same functionality of
merging trans so reuse it
have to clone feature vector as the exons gets
deleted from transcript
as the the vector is iterated - but shouldnt
there be 2 separate events?
MERGE TRANSCRIPT, and MERGE EXONS? also
wont this cloning throw things like drawables? */
moveExonsToTranscript(tran1,
(Vector)tran2.getFeatures().clone(),
"merge transcripts");
}
++++++++++++++++++++++++++++++++
private void mergeTranscripts(Vector transcripts) {
Transcript tran1 = (Transcript)transcripts.elementAt(0);
Transcript tran2 = (Transcript)transcripts.elementAt(1);
// if we merge transcripts then we have to check
that any other
// overlapping transcripts are also pulled into the
same gene
// NOTE: This is now done in consolidateGenes.
System.out.println ("\n\t****** MERGING TRANSCRIPTS
******");
/* moveExonsToTrans is the same functionality of
merging trans so reuse it
have to clone feature vector as the exons gets
deleted from transcript
as the the vector is iterated - but shouldnt
there be 2 separate events?
MERGE TRANSCRIPT, and MERGE EXONS? also
wont this cloning throw things like drawables? */
+ //URGI : for saving into chado and if the user is
merging a temp transcript with an existing transcript,
+ //get sure that the exons of the temp trans get
moved to the existing and not the contrary
+ if (isTemp(tran1) && ! isTemp(tran2)){
+ tran2=(Transcript)transcripts.elementAt(0);
+ tran1=(Transcript)transcripts.elementAt(1);
+ }
//END URGI
moveExonsToTranscript(tran1,
(Vector)tran2.getFeatures().clone(),
"merge transcripts");
}
Logged In: YES
user_id=422804
so this facet of this bug seems fixed by cyrils change here
(other facet is reducing temp names in dialog in bug 241) -
so cyril i would say commit this and then its resolved fixed
right? your changes seem good - are they ready to commit -
does it work?