-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from mims-harvard/init_version
new version and dependency removal also geneformer no scperturb fix
- Loading branch information
Showing
9 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
accelerate==0.33.0 | ||
biopython>=1.78,<2.0 | ||
dataclasses>=0.6,<1.0 | ||
datasets<2.20.0 | ||
evaluate==0.4.2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ | |
Goal is to make it easier to integrate custom datasets not yet in TDC format. | ||
""" | ||
|
||
from Bio import Entrez, SeqIO | ||
import mygene | ||
from pandas import DataFrame | ||
import requests | ||
|
||
|
@@ -37,6 +35,7 @@ def get_ncrna_sequence(cls, ncrna_id): | |
Returns: | ||
str: The nucleotide sequence of the non-coding RNA, or a message if not found. | ||
""" | ||
from Bio import Entrez, SeqIO | ||
# Provide your email to NCBI to let them know who you are | ||
Entrez.email = "[email protected]" | ||
|
||
|
@@ -88,6 +87,7 @@ def get_protein_sequence(cls, gene_name: str) -> str: | |
Returns: | ||
str: Protein amino acid sequence. | ||
""" | ||
import mygene | ||
assert isinstance(gene_name, str), (type(gene_name), gene_name) | ||
mg = mygene.MyGeneInfo() | ||
# Query MyGene.info for the given gene name | ||
|
@@ -111,6 +111,7 @@ def get_protein_sequence(cls, gene_name: str) -> str: | |
|
||
@classmethod | ||
def get_type_of_gene(cls, gene_name: str) -> str: | ||
import mygene | ||
assert isinstance(gene_name, str), (type(gene_name), gene_name) | ||
mg = mygene.MyGeneInfo() | ||
# Query MyGene.info for the given gene name | ||
|
@@ -157,9 +158,6 @@ def helper_type(gene_name): | |
if gene_column not in dataset.columns: | ||
raise ValueError(f"{gene_column} does not exist in the DataFrame.") | ||
|
||
# Ensure the DataFrame index is aligned | ||
# gene_df = gene_df.reset_index(drop=True) | ||
|
||
# Retrieve protein sequences for each gene and store them in a new column | ||
new_col = dataset[gene_column].apply(helper).tolist() | ||
assert len(new_col) == len(dataset[gene_column]), (new_col, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters