X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FPIRFile.java;h=fa9a28bf6b99eb04ffaefa5982493f9f9450569f;hb=a282e50f4076e9ec6da6a0500df2c80652a2353d;hp=6d6e52578aa4f66dcd1d184e1aeb2c964794300b;hpb=2535623533691d27fb7a23aef13d0f4f13be0a68;p=jalview.git diff --git a/src/jalview/io/PIRFile.java b/src/jalview/io/PIRFile.java index 6d6e525..fa9a28b 100755 --- a/src/jalview/io/PIRFile.java +++ b/src/jalview/io/PIRFile.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,17 +26,14 @@ import jalview.datamodel.*; public class PIRFile extends AlignFile { + public static boolean useModellerOutput = false; + Vector words = new Vector(); //Stores the words in a line after splitting public PIRFile() { } - public PIRFile(String inStr) - { - super(inStr); - } - public PIRFile(String inFile, String type) throws IOException { @@ -47,6 +44,7 @@ public class PIRFile { StringBuffer sequence; String line = null; + ModellerDescription md; while ( (line = nextLine()) != null) { @@ -93,8 +91,9 @@ public class PIRFile } seqs.addElement(newSeq); - ModellerDescription md = new ModellerDescription(newSeq. - getDescription()); + + md = new ModellerDescription(newSeq. + getDescription()); md.updateSequenceI(newSeq); } } @@ -111,17 +110,28 @@ public class PIRFile int len = 72; StringBuffer out = new StringBuffer(); int i = 0; + ModellerDescription md; while ( (i < s.length) && (s[i] != null)) { String seq = s[i].getSequence(); seq = seq + "*"; + if (is_NA) { - // modeller doesn't really do nucleotides, so we don't do anything fancy - // Nucleotide sequence tags should have a >DL; prefix - out.append(">N1;" + s[i].getName() + "\n"); // JBPNote Should change >P to >N + // modeller doesn't really do nucleotides, so we don't do anything fancy + // Official tags area as follows, for now we'll use P1 and DL + // Protein (complete) P1 + // Protein (fragment) F1 + // DNA (linear) Dl + // DNA (circular) DC + // RNA (linear) RL + // RNA (circular) RC + // tRNA N3 + // other functional RNA N1 + + out.append(">N1;" + s[i].getName() + "\n"); if (s[i].getDescription() == null) { out.append(s[i].getName() + " " + @@ -135,9 +145,23 @@ public class PIRFile } else { - out.append(">P1;" + s[i].getName() + "\n"); - ModellerDescription md = new ModellerDescription(s[i]); - out.append(md.getDescriptionLine() + "\n"); + + if(useModellerOutput) + { + out.append(">P1;" + s[i].getName() + "\n"); + md = new ModellerDescription(s[i]); + out.append(md.getDescriptionLine() + "\n"); + } + else + { + out.append(">P1;" + printId(s[i]) + "\n"); + if (s[i].getDescription() != null) + out.append(s[i].getDescription() + "\n"); + else + out.append(s[i].getName() + " " + + (s[i].getEnd() - s[i].getStart() + 1) + + " residues\n"); + } } int nochunks = (seq.length() / len) + 1;