Skip to content

Commit

Permalink
Merge pull request #6754 from thehyve/gene_info_parser_fix
Browse files Browse the repository at this point in the history
Gene info parser fix
  • Loading branch information
inodb committed Nov 27, 2019
2 parents d20782c + cb50b7e commit 8a953f7
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,21 @@ public static void importData(File geneFile, String genomeBuild) throws IOExcept
String strAliases = parts[4];
String strXrefs = parts[5];
String cytoband = parts[7];
String chr = cytoband.split("p|q")[0];
String chr = cytoband.split("p|q|;|c")[0]; // various strange characters were found in this column
int referenceGenomeId = DaoReferenceGenome.getReferenceGenomeByBuildName(genomeBuild).getReferenceGenomeId();
String desc = parts[8];
String type = parts[9];
String mainSymbol = parts[10]; // use 10 instead of 2 since column 2 may have duplication
Set<String> aliases = new HashSet<String>();

// try to get chr from other column if needed
if (chr.equals("-")) {
if (!parts[6].equals("-")) {
chr = parts[6];
} else {
continue; // skip if both columns are absent
}
}
if (!locusTag.equals("-")) {
aliases.add(locusTag);
}
Expand Down Expand Up @@ -504,9 +512,17 @@ else if (i.contains("gene_name")) {
public static boolean updateLength(String symbol, String chromosome, List<long[]> loci, int refreneceGenomeId) throws IOException, DaoException {
DaoGeneOptimized daoGeneOptimized = DaoGeneOptimized.getInstance();
CanonicalGene gene = daoGeneOptimized.getNonAmbiguousGene(symbol);

boolean lengthUpdated = false;

if (gene == null) {
ProgressMonitor.logWarning("Unable to retrieve gene by symbol: " +symbol);
return lengthUpdated;
}

System.out.println(" --> update reference genome gene: " + gene.getHugoGeneSymbolAllCaps());
DaoReferenceGenomeGene daoReferenceGenomeGene = DaoReferenceGenomeGene.getInstance();
boolean lengthUpdated = false;

/// Check if the gene is in the database
ReferenceGenomeGene refGene = daoReferenceGenomeGene.getGene(gene.getEntrezGeneId(), refreneceGenomeId);
/// If it's not in the database, don't add it
Expand Down

0 comments on commit 8a953f7

Please sign in to comment.