Author: scooter
Date: 2011-11-04 12:19:48 -0700 (Fri, 04 Nov 2011)
New Revision: 27405
Modified:
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CreateNetworkAction.java
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/ChimeraResidue.java
Log:
Added 2D pictograms for amino acids to RIN networks
Modified:
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CreateNetworkAction.java
===================================================================
---
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CreateNetworkAction.java
2011-11-04 07:08:20 UTC (rev 27404)
+++
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/actions/CreateNetworkAction.java
2011-11-04 19:19:48 UTC (rev 27405)
@@ -85,6 +85,7 @@
static final String SEED_ATTR = "SeedResidue";
static final String BACKBONE_ATTR = "BackboneInteraction";
static final String SIDECHAIN_ATTR = "SideChainInteraction";
+ static final String SMILES_ATTR = "SMILES";
public CreateNetworkAction(Chimera chimeraObject) {
this.chimeraObject = chimeraObject;
@@ -159,12 +160,10 @@
// printReply(replyList);
}
if (includeConnectivity) {
- System.out.println("Getting Connectivity");
monitor.setStatus("Getting Connectivity");
String command = "listphysicalchains";
List<String>replyList =
chimeraObject.commandReply(command);
if (canceled) return;
- System.out.println("Getting Connectivity Edges");
edgeList.addAll(parseConnectivityReplies(replyList, new
ArrayList<CyNode>(nodeMap.keySet())));
}
@@ -202,6 +201,19 @@
String structure =
CyChimera.findStructures(residueSpec);
Structure s = Structure.getStructure(structure, node,
StructureType.PDB_MODEL);
s.setResidueList(node, residueSpec);
+ if (residueSpec.indexOf('-') < 0 &&
residueSpec.indexOf(',') < 0) {
+ String[] r = node.getIdentifier().split(" ");
+ String smiles =
ChimeraResidue.toSMILES(r[0].toUpperCase());
+ if (smiles != null) {
+ if (nodeAttributes.getType(SMILES_ATTR)
== CyAttributes.TYPE_SIMPLE_LIST) {
+ List l = new ArrayList();
+ l.add(smiles);
+
nodeAttributes.setListAttribute(node.getIdentifier(), SMILES_ATTR, l);
+ } else {
+
nodeAttributes.setAttribute(node.getIdentifier(), SMILES_ATTR, smiles);
+ }
+ }
+ }
}
}
Modified:
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/ChimeraResidue.java
===================================================================
---
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/ChimeraResidue.java
2011-11-04 07:08:20 UTC (rev 27404)
+++
csplugins/trunk/ucsf/scooter/structureViz/src/structureViz/model/ChimeraResidue.java
2011-11-04 19:19:48 UTC (rev 27405)
@@ -341,30 +341,31 @@
private static void initNames() {
// Create our residue name table
aaNames = new HashMap();
- aaNames.put("ALA","A Ala Alanine");
- aaNames.put("ARG","R Arg Arginine");
- aaNames.put("ASN","N Asn Asparagine");
- aaNames.put("ASP","D Asp Aspartic_acid");
- aaNames.put("CYS","C Cys Cysteine");
- aaNames.put("GLN","Q Gln Glutamine");
- aaNames.put("GLU","E Glu Glumatic_acid");
- aaNames.put("GLY","G Gly Glycine");
- aaNames.put("HIS","H His Histidine");
- aaNames.put("ILE","I Ile Isoleucine");
- aaNames.put("LEU","L Leu Leucine");
- aaNames.put("LYS","K Lys Lysine");
- aaNames.put("MET","M Met Methionine");
- aaNames.put("PHE","F Phe Phenylalanine");
- aaNames.put("PRO","P Pro Proline");
- aaNames.put("SER","S Ser Serine");
- aaNames.put("THR","T Thr Threonine");
- aaNames.put("TRP","W Trp Tryptophan");
- aaNames.put("TYR","Y Tyr Tyrosine");
- aaNames.put("VAL","V Val Valine");
+ aaNames.put("ALA","A Ala Alanine N[C@@H](C)C(O)=O");
+ aaNames.put("ARG","R Arg Arginine N[C@@H](CCCNC(N)=N)C(O)=O");
+ aaNames.put("ASN","N Asn Asparagine N[C@@H](CC(N)=O)C(O)=O");
+ aaNames.put("ASP","D Asp Aspartic_acid N[C@@H](CC(O)=O)C(O)=O");
+ aaNames.put("CYS","C Cys Cysteine N[C@@H](CS)C(O)=O");
+ aaNames.put("GLN","Q Gln Glutamine N[C@H](C(O)=O)CCC(N)=O");
+ aaNames.put("GLU","E Glu Glumatic_acid N[C@H](C(O)=O)CCC(O)=O");
+ aaNames.put("GLY","G Gly Glycine NCC(O)=O");
+ aaNames.put("HIS","H His Histidine N[C@@H](CC1=CN=CN1)C(O)=O");
+ aaNames.put("ILE","I Ile Isoleucine
N[C@]([C@H](C)CC)([H])C(O)=O");
+ aaNames.put("LEU","L Leu Leucine N[C@](CC(C)C)([H])C(O)=O");
+ aaNames.put("LYS","K Lys Lysine N[C@](CCCCN)([H])C(O)=O");
+ aaNames.put("DLY","K Dly D-Lysine NCCCC[C@@H](N)C(O)=O");
+ aaNames.put("MET","M Met Methionine N[C@](CCSC)([H])C(O)=O");
+ aaNames.put("PHE","F Phe Phenylalanine
N[C@](CC1=CC=CC=C1)([H])C(O)=O");
+ aaNames.put("PRO","P Pro Proline OC([C@@]1([H])NCCC1)=O");
+ aaNames.put("SER","S Ser Serine OC[C@](C(O)=O)([H])N");
+ aaNames.put("THR","T Thr Threonine
O[C@H](C)[C@](C(O)=O)([H])N");
+ aaNames.put("TRP","W Trp Tryptophan
N[C@@]([H])(CC1=CN([H])C2=C1C=CC=C2)C(O)=O");
+ aaNames.put("TYR","Y Tyr Tyrosine
N[C@@](C(O)=O)([H])CC1=CC=C(O)C=C1");
+ aaNames.put("VAL","V Val Valine N[C@@](C(O)=O)([H])C(C)C");
aaNames.put("ASX","B Asx Aspartic_acid_or_Asparagine");
aaNames.put("GLX","Z Glx Glutamine_or_Glutamic_acid");
aaNames.put("XAA","X Xaa Any_or_unknown_amino_acid");
- aaNames.put("HOH","HOH HOH Water");
+ aaNames.put("HOH","HOH HOH Water [H]O[H]");
}
/**
@@ -384,7 +385,7 @@
* @param aaType the residue type to convert
* @return the full name of the residue
*/
- private static String toFullName(String aaType) {
+ public static String toFullName(String aaType) {
if (!aaNames.containsKey(aaType))
return aaType;
String[] ids = ((String)aaNames.get(aaType)).split(" ");
@@ -397,7 +398,7 @@
* @param aaType the residue type to convert
* @return the single letter representation of the residue
*/
- private static String toSingleLetter(String aaType) {
+ public static String toSingleLetter(String aaType) {
if (!aaNames.containsKey(aaType))
return aaType;
String[] ids = ((String)aaNames.get(aaType)).split(" ");
@@ -410,10 +411,24 @@
* @param aaType the residue type to convert
* @return the three letter representation of the residue
*/
- private static String toThreeLetter(String aaType) {
+ public static String toThreeLetter(String aaType) {
if (!aaNames.containsKey(aaType))
return aaType;
String[] ids = ((String)aaNames.get(aaType)).split(" ");
return ids[1];
}
+
+ /**
+ * Convert the amino acid type to its SMILES string
+ *
+ * @param aaType the residue type to convert
+ * @return the SMILES representation of the residue
+ */
+ public static String toSMILES(String aaType) {
+ if (!aaNames.containsKey(aaType))
+ return null;
+ String[] ids = ((String)aaNames.get(aaType)).split(" ");
+ if (ids.length < 4) return null;
+ return ids[3];
+ }
}
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.