Comments (10)
Hi, thanks for reporting this! This error is indeed due to the most recent pandas version, and occurs in pandas_plink
. I posted an issue (limix/pandas-plink#18). In the meantime, please use Pandas 1.0.5.
from tensorqtl.
No, R is only used at the very end, to calculate q-values. The code above crashes on batch 8, which suggests that the error originates with the first batch processed on the GPU (batches are pre-loaded in a separate thread). Without seeing the python stack trace it's impossible to guess what is causing this.
from tensorqtl.
I downgraded pandas to 1.0.5 by editing the requirements.
Furthermore when performing cis nominal mapping I retrieve another error:
`cis = cis.map_nominal(genotype_df, variant_df, phenotype_df, phenotype_pos_df, covariates_df, prefix)
cis-QTL mapping: nominal associations for all variant-phenotype pairs
- 445 samples
- 19836 phenotypes
Traceback (most recent call last):
File "", line 1, in
File "/home/aduarte/tensorqtl/tensorqtl/cis.py", line 157, in map_nominal
assert np.all(phenotype_df.columns==covariates_df.index)
AssertionError`
I'm using the provided example dataset as assurance of input quality
from tensorqtl.
The error in example/tensorqtl_examples.ipynb is fixed in d812a2a. The argument order of map_nominal
was changed to make covariates optional.
from tensorqtl.
Thank you for the quick comeback, it fixed that problem.
Now I can go all the way to nominal mapping where it chrashes hard:
import tensorqtl
from tensorqtl import genotypeio, cis, trans
print('PyTorch {}'.format(torch.__version__))
PyTorch 1.6.0
print('Pandas {}'.format(pd.__version__))
Pandas 1.0.5
plink_prefix_path = './example/GEUVADIS.445_samples.GRCh38.20170504.maf01.filtered.nodup.bed'
expression_bed = './example/GEUVADIS.445_samples.expression.bed.gz'
covariates_file = './example/GEUVADIS.445_samples.covariates.txt'
prefix = 'Geuvadis_results.'
phenotype_df, phenotype_pos_df = tensorqtl.read_phenotype_bed(expression_bed)
\t', index_col=0).T
covariates_df = pd.read_csv(covariates_file, sep='\t', index_col=0).T
pr = genotypeio.PlinkReader(plink_prefix_path)
Mapping files: 100%|████████████████████████| 3/3 [00:23<00:00, 7.67s/it]
genotype_df = pr.load_genotypes()
variant_df = pr.bim.set_index('snp')[['chrom', 'pos']]
cis.map_nominal(genotype_df, variant_df,
... phenotype_df.loc[phenotype_pos_df['chr']=='chr18'],
... phenotype_pos_df.loc[phenotype_pos_df['chr']=='chr18'],
... prefix, covariates_df=covariates_df)
cis-QTL mapping: nominal associations for all variant-phenotype pairs
* 445 samples
* 301 phenotypes
* 26 covariates
* 13369268 variants
* checking phenotypes: 301/301
* Computing associations
Mapping chromosome chr18
processing phenotype 301/301
time elapsed: 0.83 min
* writing output
done.
cis_df = cis.map_cis(genotype_df, variant_df,
... phenotype_df.loc[phenotype_pos_df['chr']=='chr18'],
... phenotype_pos_df.loc[phenotype_pos_df['chr']=='chr18'],
... covariates_df=covariates_df, seed=123456)
cis-QTL mapping: empirical p-values for phenotypes
* 445 samples
* 301 phenotypes
* 26 covariates
* 13369268 variants
* using seed 123456
* checking phenotypes: 301/301
* computing permutations
processing phenotype 8/301R[write to console]:
*** caught illegal operation ***
R[write to console]: address 0x7fe9da6ea409, cause 'illegal operand'
R[write to console]:
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:```
from tensorqtl.
The entire notebook runs without problems for me, with the same module versions. What environment are you running this in, and why are you getting R errors at the end?
from tensorqtl.
I'm using RStudio's terminal on a linux machine to run all commands
uname -a
Linux rey 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
from tensorqtl.
Can you try to run this within python/ipython/jupyter instead?
from tensorqtl.
@francois-a: Aren't the R errors resulting from R code being used through rpy2?
from tensorqtl.
The original error is fixed in limix/pandas-plink#19. @aarbduarte please open a new issue if you still can't get the example notebook to run.
from tensorqtl.
Related Issues (20)
- coloc qnorm method HOT 2
- QTL interaction HOT 1
- Inconsistent tss_distance in cis.map_nominal and cis.map_independent HOT 4
- Approximate the adjusted P-value from the best nominal P-value HOT 2
- TensorQTL for Methylation QTL analysis HOT 1
- v1.0.7 Docker container build fails HOT 3
- sQTL analysis TSS
- TensorQTL analysis problem HOT 7
- Which is the effect allele? HOT 3
- pgenlib error HOT 1
- Expected format for --interaction parameter HOT 2
- How to use Plink2 files including multiallelic file HOT 2
- An error in tensorqtl_examples.ipynb ? HOT 1
- Reproduce GTEx v8 HOT 3
- Interaction mode: k variable overwrite in cis.py script (v1.0.7) HOT 1
- nominal p value threshold for non-top eVariants in interaction mode
- missing pval_nominal_threshold column in output cis_qtl.txt file HOT 1
- Output Documentation HOT 3
- TensorQTL load Plink2 files in command line HOT 1
- Can we use tensorqtl without a covariate? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorqtl.