-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a stub for sci-RNA-seq data translation (#324)
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/home/ubuntu/env/bin/python | ||
|
||
from rpy2.robjects.packages import importr | ||
from rpy2.robjects import r as R | ||
from PyOpenWorm.datasource import DataTranslator, DataSource, Informational | ||
|
||
|
||
class SCIRNASeqDataSource(DataSource): | ||
data_url = Informational('Data URL') | ||
|
||
|
||
class SCIRNASeqTranslator(DataTranslator): | ||
|
||
def translate(self, ds): | ||
url = ds.data_url().pop() | ||
base = importr('base') | ||
utils = importr('utils') | ||
utils.download_file(url, destfile="data_source.RData") | ||
base.load("data_source.RData") | ||
cds = R('cds') | ||
print(cds) | ||
|
||
|
||
__yarom_mapped_classes__ = (SCIRNASeqTranslator, SCIRNASeqDataSource) |
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