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

number of trans-qtl tests #173

Open
liaguiro opened this issue Dec 18, 2024 · 2 comments
Open

number of trans-qtl tests #173

liaguiro opened this issue Dec 18, 2024 · 2 comments

Comments

@liaguiro
Copy link

Hello,

I calculated about 24.8 M possible trans qtl tests but got 18.8 M trans-qtl test results when I ran the trans-QTL mapping with --pval_threshold 1. I'm wondering why tensor-qtl ran fewer trans-qtl tests. Does tensorqtl do additional filtering? or did I estimate the number of possible trans-qtl tests wrong?

same.chr.cis.gene.snp <- unnest(gene.TSS, col = snp.table) %>% mutate(same.chr = gene.Chr == snp.CHROM, dist.gene.snp.window = snp.POS >= gene.TSS.start - 500000 & snp.POS <= gene.TSS.end + 500000) %>% filter(same.chr) %>% filter(dist.gene.snp.window)

same.chr.trans.gene.snp <- unnest(gene.TSS, col = snp.table) %>% mutate(same.chr = gene.Chr == snp.CHROM, dist.gene.snp.window = snp.POS >= gene.TSS.start - 500000 & snp.POS <= gene.TSS.end + 500000) %>% filter(same.chr) %>% filter(!dist.gene.snp.window)

dif.chr.trans.gene.snp <- unnest(gene.TSS, col = snp.table) %>% mutate(same.chr = gene.Chr == snp.CHROM, dist.gene.snp.window = snp.POS >= gene.TSS.start - 500000 & snp.POS <= gene.TSS.end + 500000) %>% filter(!same.chr)

all.trans.gene.snp <- bind_rows(same.chr.trans.gene.snp, dif.chr.trans.gene.snp)

@francois-a
Copy link
Collaborator

The default maf_threshold for trans-QTL mapping is 0.05, which likely explains the missing pairs. If you want to output all pairs, you may want to use --return_dense instead of setting pval_threshold to 1.

@liaguiro
Copy link
Author

I used --return_dense instead of --pval_threshold to 1 and got the following error. When I ran trans-qtl with pval_treshold, it worked. I'm not sure how to fix this error

/tensorqtl/trans.py:188: FutureWarning: Series.getitem treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use ser.iloc[pos]
interaction_mask_t = torch.BoolTensor(mask_s).to(device)
trans-QTL mapping

  • 287 samples
  • 22447 phenotypes
  • 1 covariates
  • 1111 variants
  • including interaction term
    ^M processing batch 1/1
    Traceback (most recent call last):
    File "", line 198, in _run_module_as_main
    File "", line 88, in _run_code
    File "/tensorqtl/main.py", line 2, in
    tensorqtl.main()
    File "/tensorqtl/tensorqtl.py", line 328, in main
    pairs_df = trans.map_trans(genotype_df, phenotype_df, covariates_df=covariates_df, interaction_s=interaction_df,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tensorqtl/trans.py", line 276, in map_trans
    res = calculate_interaction_nominal(genotypes_t, phenotypes_t, interaction_t, residualizer,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tensorqtl/core.py", line 189, in calculate_interaction_nominal
    i0_t = residualizer.transform(i0_t.t(), center=False).t()
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tensorqtl/core.py", line 62, in transform
    M0_t = M_t - torch.mm(torch.mm(M0_t, self.Q_t), self.Q_t.t())
    ^^^^^^^^^^^^^^^^^^^^^^^^
    RuntimeError: mat1 and mat2 shapes cannot be multiplied (287x1 and 287x1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants