<commit_before>
package org.mskcc.portal.remote;

import org.mskcc.portal.util.XDebug;

import java.io.IOException;

import java.net.URL;

import java.rmi.RemoteException;

import java.util.List;

import org.mskcc.portal.network.Network;
import org.mskcc.portal.network.NetworkIO;
import org.mskcc.portal.util.GlobalProperties;

/**
 * Gets network from Pathway Commons.
 * @author jj
 */
public class GetPathwayCommonsNetwork {

    /**
     * Gets network of interest of seed genes.
     *
     * @param geneList Gene List.
     * @return Tab-delimited content.
     */
    public Network getNetwork (List<String> geneList,
          XDebug xdebug) throws RemoteException {
        try {
            StringBuilder sbUrl = new StringBuilder(GlobalProperties.getPathwayCommonsUrl());
			sbUrl.append("/graph?format=EXTENDED_BINARY_SIF&kind=NEIGHBORHOOD");
            for (String gene : geneList) {
                sbUrl.append("&source=urn:biopax:RelationshipXref:HGNC_");
                sbUrl.append(gene);
            }
            
            //xdebug.logMsg(this, "URL: "+sbUrl.toString());
            return NetworkIO.readNetworkFromCPath2(new URL(sbUrl.toString()).openStream());
        } catch (IOException e) {
            throw new RemoteException("Remote Access Error", e);
        }
        
    }
}<commit_msg>Code to convert gene name to upper case before calling cpath2 webservice.  In this case, before portal code can notify user of unknown gene, a call is made to cpath2 graph web service.  Web service returns a search result of 0 items that is not currently checked for in portal code.<commit_after>
package org.mskcc.portal.remote;

import org.mskcc.portal.util.XDebug;

import java.io.IOException;

import java.net.URL;

import java.rmi.RemoteException;

import java.util.List;

import org.mskcc.portal.network.Network;
import org.mskcc.portal.network.NetworkIO;
import org.mskcc.portal.util.GlobalProperties;

/**
 * Gets network from Pathway Commons.
 * @author jj
 */
public class GetPathwayCommonsNetwork {

    /**
     * Gets network of interest of seed genes.
     *
     * @param geneList Gene List.
     * @return Tab-delimited content.
     */
    public Network getNetwork (List<String> geneList,
          XDebug xdebug) throws RemoteException {
        try {
            StringBuilder sbUrl = new StringBuilder(GlobalProperties.getPathwayCommonsUrl());
			sbUrl.append("/graph?format=EXTENDED_BINARY_SIF&kind=NEIGHBORHOOD");
            for (String gene : geneList) {
                sbUrl.append("&source=urn:biopax:RelationshipXref:HGNC_");
                sbUrl.append(gene.toUpperCase());
            }
            
            //xdebug.logMsg(this, "URL: "+sbUrl.toString());
            return NetworkIO.readNetworkFromCPath2(new URL(sbUrl.toString()).openStream());
        } catch (IOException e) {
            throw new RemoteException("Remote Access Error", e);
        }
        
    }
}
{'fraction_non_alphanumeric': 0.1035069799114743, 'fraction_numerical': 0.0017024174327545114, 'mean_word_length': 2.790967741935484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6720011', 'n_tokens_mistral': 871, 'n_tokens_neox': 864, 'n_words': 208}