Hi David.

On 04/06/2014 18:33, David M Garcia wrote:
> Is there a way I can extract the conservation values corresponding to 
> one of the other proteins in the alignment? I would like to be able to 
> extract conservation scores for the residues only present in certain 
> proteins in my alignment (in an excel friendly format), without all 
> the gaps.
I've lodged a feature request about this 
(http://issues.jalview.org/browse/JAL-1516). I also came up with a 
fairly messy script that might do what you need:

Open Jalview's groovy console 
(http://www.jalview.org/help/html/features/groovy.html) and paste in the 
following:

// very messy script to output the scores in annotation rows for the 
first sequence in a selection on the topmost alignment
def curviewport = 
Jalview.getAlignframes()[Jalview.getAlignframes().length-1].getViewport();
if (curviewport.getSelectionGroup()) {
   // gets selection for 'first' alignment - note this is the 'oldest' 
one - can't access the current alignment as yet
   def selreg = curviewport.getSelectionGroup();
   def gaps = selreg.getSequenceAt(0).gapMap(); // aligned positions of 
first sequence selected
   String csvfile="";
   curviewport.getAlignment().getAlignmentAnnotation().eachWithIndex{ 
aa, apos ->
     String csv=""
     gaps.eachWithIndex{col,spos -> if (col>=selreg.getStartRes() && 
col<=selreg.getEndRes()) {
       // output height of histogram
       csv+=","+aa.annotations[col].value;
       // Uncomment to output string shown in tooltip
       // csv+=","+aa.annotations[col].description;
     }}
     if (csv.length()>0) {
         csvfile+=aa.label+csv+"\n"
     }
   }
   print csvfile;
} else {
     "Select a region in the alignment window.";
}
///

Hope that helps!
Jim

ps. You can also find this script in a comment on the feature request: 
http://issues.jalview.org/browse/JAL-1516?focusedCommentId=13296&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13296





_______________________________________________
Jalview-discuss mailing list
[email protected]
http://www.compbio.dundee.ac.uk/mailman/listinfo/jalview-discuss

Reply via email to