Permalink
Browse files

updating protein self-relationships stuff (no self-relationships node…

… anymore)
  • Loading branch information...
Pablo Pareja Tobes
Pablo Pareja Tobes committed Sep 27, 2011
1 parent 84c49ae commit f6bd2fafc50f4c836b54780983491db6f1383eee
@@ -88,12 +88,9 @@
public static final String FEATURE_LOCATION_END_TAG_NAME = "end";
public static final String FEATURE_LOCATION_POSITION_ATTRIBUTE = "position";
public static final String FEATURE_POSITION_POSITION_ATTRIBUTE = "position";
-
-
+
public static final String REFSEQ_BUCKET_NAME = "refseq-bucket";
- public static final String PROTEIN_SELF_RELATIONSHIPS_NODE_INDEX_NAME = "self_relationships_node_index";
- public static final String PROTEIN_SELF_RELATIONSHIPS_NODE_INDEX_VALUE = "protein_self_relationships";
}
@@ -20,7 +20,6 @@
import com.era7.bioinfo.bio4j.CommonData;
import com.era7.bioinfo.bio4jmodel.relationships.protein.ProteinIsoformInteractionRel;
import com.era7.bioinfo.bio4jmodel.relationships.protein.ProteinProteinInteractionRel;
-import com.era7.bioinfo.bio4jmodel.relationships.protein.ProteinSelfInteractionRel;
import com.era7.lib.bioinfo.bioinfoutil.Executable;
import com.era7.lib.era7xmlapi.model.XMLElement;
import java.io.BufferedReader;
@@ -137,23 +136,16 @@ public static void main(String[] args) throws IOException {
//--------------------------------relationships------------------------------------------
ProteinProteinInteractionRel proteinProteinInteractionRel = new ProteinProteinInteractionRel(null);
ProteinIsoformInteractionRel proteinIsoformInteractionRel = new ProteinIsoformInteractionRel(null);
- ProteinSelfInteractionRel proteinSelfInteractionRel = new ProteinSelfInteractionRel(null);
//------------------------------------------------------------------------------------------------
//------------------indexes creation----------------------------------
BatchInserterIndex proteinAccessionIndex = indexProvider.nodeIndex(ProteinNode.PROTEIN_ACCESSION_INDEX,
MapUtil.stringMap(PROVIDER_ST, LUCENE_ST, TYPE_ST, EXACT_ST));
BatchInserterIndex isoformIdIndex = indexProvider.nodeIndex(IsoformNode.ISOFORM_ID_INDEX,
MapUtil.stringMap(PROVIDER_ST, LUCENE_ST, TYPE_ST, EXACT_ST));
- BatchInserterIndex proteinSelfRelationshipsNodeIndex = indexProvider.nodeIndex(CommonData.PROTEIN_SELF_RELATIONSHIPS_NODE_INDEX_NAME,
- MapUtil.stringMap(PROVIDER_ST, LUCENE_ST, TYPE_ST, EXACT_ST));
//--------------------------------------------------------------------
- long proteinSelfInteractionsNodeId = proteinSelfRelationshipsNodeIndex.get(CommonData.PROTEIN_SELF_RELATIONSHIPS_NODE_INDEX_NAME, CommonData.PROTEIN_SELF_RELATIONSHIPS_NODE_INDEX_VALUE).getSingle();
- System.out.println("proteinSelfInteractionsNodeId = " + proteinSelfInteractionsNodeId);
-
-
BufferedReader reader = new BufferedReader(new FileReader(inFile));
String line = null;
StringBuilder entryStBuilder = new StringBuilder();
@@ -233,47 +225,35 @@ public static void main(String[] args) throws IOException {
// System.out.println("currentProteinId = " + currentProteinId);
}
- if (!interactionWithItself) {
- if (protein2Id < 0) {
- //Since we did not find the protein we try to find a isoform instead
- long isoformId = -1;
- IndexHits<Long> isoformIdIndexHits = isoformIdIndex.get(IsoformNode.ISOFORM_ID_INDEX, interactant2AccessionSt);
- if (isoformIdIndexHits.hasNext()) {
- if (isoformIdIndexHits.size() == 1) {
- isoformId = isoformIdIndexHits.getSingle();
- }
- }
- if (isoformId >= 0) {
-
- proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.EXPERIMENTS_PROPERTY, experimentsSt);
- proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.ORGANISMS_DIFFER_PROPERTY, organismsDifferSt);
- proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.INTACT_ID_1_PROPERTY, intactId1St);
- proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.INTACT_ID_2_PROPERTY, intactId2St);
-
- inserter.createRelationship(currentProteinId, isoformId, proteinIsoformInteractionRel, proteinIsoformInteractionProperties);
-
+ if (protein2Id < 0) {
+ //Since we did not find the protein we try to find a isoform instead
+ long isoformId = -1;
+ IndexHits<Long> isoformIdIndexHits = isoformIdIndex.get(IsoformNode.ISOFORM_ID_INDEX, interactant2AccessionSt);
+ if (isoformIdIndexHits.hasNext()) {
+ if (isoformIdIndexHits.size() == 1) {
+ isoformId = isoformIdIndexHits.getSingle();
}
- } else {
+ }
+ if (isoformId >= 0) {
- proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.EXPERIMENTS_PROPERTY, experimentsSt);
- proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.ORGANISMS_DIFFER_PROPERTY, organismsDifferSt);
- proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.INTACT_ID_1_PROPERTY, intactId1St);
- proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.INTACT_ID_2_PROPERTY, intactId2St);
+ proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.EXPERIMENTS_PROPERTY, experimentsSt);
+ proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.ORGANISMS_DIFFER_PROPERTY, organismsDifferSt);
+ proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.INTACT_ID_1_PROPERTY, intactId1St);
+ proteinIsoformInteractionProperties.put(ProteinIsoformInteractionRel.INTACT_ID_2_PROPERTY, intactId2St);
- inserter.createRelationship(currentProteinId, protein2Id, proteinProteinInteractionRel, proteinProteinInteractionProperties);
+ inserter.createRelationship(currentProteinId, isoformId, proteinIsoformInteractionRel, proteinIsoformInteractionProperties);
}
} else {
- //this is the case where one protein interacts with itself
- proteinSelfInteractionProperties.put(ProteinSelfInteractionRel.EXPERIMENTS_PROPERTY, experimentsSt);
- proteinSelfInteractionProperties.put(ProteinSelfInteractionRel.ORGANISMS_DIFFER_PROPERTY, organismsDifferSt);
- proteinSelfInteractionProperties.put(ProteinSelfInteractionRel.INTACT_ID_1_PROPERTY, intactId1St);
- proteinSelfInteractionProperties.put(ProteinSelfInteractionRel.INTACT_ID_2_PROPERTY, intactId2St);
+ proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.EXPERIMENTS_PROPERTY, experimentsSt);
+ proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.ORGANISMS_DIFFER_PROPERTY, organismsDifferSt);
+ proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.INTACT_ID_1_PROPERTY, intactId1St);
+ proteinProteinInteractionProperties.put(ProteinProteinInteractionRel.INTACT_ID_2_PROPERTY, intactId2St);
- inserter.createRelationship(currentProteinId, proteinSelfInteractionsNodeId, proteinSelfInteractionRel, proteinSelfInteractionProperties);
- }
+ inserter.createRelationship(currentProteinId, protein2Id, proteinProteinInteractionRel, proteinProteinInteractionProperties);
+ }
}
@@ -30,9 +30,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
-import org.neo4j.graphdb.index.BatchInserterIndex;
import org.neo4j.graphdb.index.BatchInserterIndexProvider;
-import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProvider;
import org.neo4j.kernel.impl.batchinsert.BatchInserter;
import org.neo4j.kernel.impl.batchinsert.BatchInserterImpl;
@@ -82,7 +80,6 @@ public static void main(String[] args) {
Map<String, Object> alternativeProductProperties = new HashMap<String, Object>();
Map<String, Object> sequenceCautionProperties = new HashMap<String, Object>();
- Map<String, Object> proteinSelfInteractionsProperties = new HashMap<String, Object>();
long alternativeProductInitiationId;
long alternativeProductPromoterId;

0 comments on commit f6bd2fa

Please sign in to comment.