Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add basic support for tracking gene type (not exposed anywhere) #638

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public Gene convert( NCBIGeneInfo info ) {
gene.setOfficialSymbol( info.getDefaultSymbol() );
gene.setOfficialName( info.getDescription() );
gene.setEnsemblId( info.getEnsemblId() );
gene.setType(info.getGeneType().toString());

/*
* NOTE we allow multiple discontinued or previous ids, separated by commas. This is a hack to account for cases
Expand Down
10 changes: 10 additions & 0 deletions gemma-core/src/main/java/ubic/gemma/model/genome/Gene.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
package ubic.gemma.model.genome;

import ubic.gemma.core.loader.genome.gene.ncbi.model.NCBIGeneInfo;
import ubic.gemma.model.association.phenotype.PhenotypeAssociation;
import ubic.gemma.model.common.description.DatabaseEntry;
import ubic.gemma.model.genome.gene.GeneAlias;
Expand Down Expand Up @@ -47,13 +48,22 @@ public class Gene extends ChromosomeFeature {
private Set<DatabaseEntry> accessions = new HashSet<>();
private Multifunctionality multifunctionality;
private Set<PhenotypeAssociation> phenotypeAssociations = new HashSet<>();
private NCBIGeneInfo.GeneType type;

/**
* No-arg constructor added to satisfy javabean contract
*/
public Gene() {
}

public String getType() {
return type.toString();
}

public void setType( String type ) {
this.type = NCBIGeneInfo.typeStringToGeneType( type );
}

@Override
public boolean equals( Object object ) {
if ( this == object ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
<column name="ENSEMBL_ID" not-null="false" unique="false"
sql-type="VARCHAR(255)"/>
</property>
<property name="type" type="java.lang.String">
<column name="TYPE" not-null="false" unique="false"
sql-type="VARCHAR(255)"/>
</property>
<set name="products" lazy="true" fetch="select" inverse="true" cascade="all">
<cache usage="read-write"/>
<key foreign-key="GENE_PRODUCT_GENE_FKC">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import junit.framework.TestCase;
import org.springframework.core.io.ClassPathResource;
import ubic.gemma.core.loader.genome.gene.ncbi.model.NCBIGeneInfo;

import java.io.InputStream;
import java.util.HashMap;
Expand All @@ -45,6 +46,8 @@ public void testParseGeneInfo() throws Exception {
ncbiGeneInfoParser.setFilter( false );
ncbiGeneInfoParser.parse( is );
TestCase.assertEquals( 99, ncbiGeneInfoParser.getResults().size() );
NCBIGeneInfo n = ncbiGeneInfoParser.getResults().iterator().next();
assertNotNull( n.getGeneType() );
}

}