Giter VIP home page Giter VIP logo

Comments (6)

zmli0831 avatar zmli0831 commented on September 25, 2024

obj_nullmodel <- fit_nullmodel(lung_ca~age+sex+typesmok+pca1+pca2+pca3,

  •                            data=phenotype,kins=as.matrix(sgrm),use_sparse=TRUE,kins_cutoff=0.022,id="plink_request",family=binomial(link = "logit"),verbose=TRUE)
    

[1] "kins is a dense matrix, transforming it into a sparse matrix using cutoff 0.022."
Using 39408 samples provided
double free or corruption (!prev)
Aborted (core dumped)

from staarpipeline-tutorial.

xihaoli avatar xihaoli commented on September 25, 2024

Hi @zmli0831, could I ask how did you generate your sgrm?

from staarpipeline-tutorial.

zmli0831 avatar zmli0831 commented on September 25, 2024

Thank you very much for your reply! The sgrm matrix was generated by using the procedures as follow:

/home/zmli/plink/plink --bfile /home/zmli/software/STAAR/Example/Example --indep-pairwise 50 5 0.1 --out /home/zmli/software/STAAR/Example/chrall.prunedlist;
/home/zmli/plink/plink --bfile /home/zmli/software/STAAR/Example/Example --extract /home/zmli/software/STAAR/Example/chrall.prunedlist.prune.in --make-bed --out /home/zmli/software/STAAR/Example/chrall_pruned
/home/zmli/plink/plink --bfile /home/zmli/software/STAAR/Example/chrall_pruned --mac 5 --make-bed --out /home/zmli/software/STAAR/Example/chrall_pruned_mac5

/home/zmli/software/king/king -b /home/zmli/software/STAAR/Example/Example.bed --ibdseg --degree 4 --cpus 2 --prefix /home/zmli/software/STAAR/Example/output.king

R CMD BATCH --vanilla '--args --prefix.in /home/zmli/software/STAAR/Example/chrall_pruned_mac5 --file.seg /home/zmli/software/STAAR/Example/output.king.seg --num_threads 2 --prefix.out Exampleoutput.divergence' /home/zmli/software/STAAR/FastSparseGRM-main/extdata/getDivergence_wrapper.R getDivergence.Rout

R CMD BATCH --vanilla '--args --prefix.in /home/zmli/software/STAAR/Example/chrall_pruned_mac5 --file.seg /home/zmli/software/STAAR/Example/output.king.seg --file.div /home/zmli/software/STAAR/Example/Exampleoutput.divergence.div --prefix.out Exampleoutput.unrelated' /home/zmli/software/STAAR/FastSparseGRM-main/extdata/extractUnrelated_wrapper.R extractUnrelated.Rout

R CMD BATCH --vanilla '--args --prefix.in /home/zmli/software/STAAR/Example/chrall_pruned_mac5 --file.unrels /home/zmli/software/STAAR/Example/Exampleoutput.unrelated.unrels --prefix.out /home/zmli/software/STAAR/Example/Exampleoutput.pca --num_threads 10' /home/zmli/software/STAAR/FastSparseGRM-main/extdata/runPCA_wrapper.R runPCA.Rout

R CMD BATCH --vanilla '--args --prefix.in /home/zmli/software/STAAR/Example/chrall_pruned_mac5 --prefix.out /home/zmli/software/STAAR/Example/Exampleoutput.sparseGRM --file.train /home/zmli/software/STAAR/Example/Exampleoutput.unrelated.unrels --file.score /home/zmli/software/STAAR/Example/Exampleoutput.pca.score --file.seg /home/zmli/software/STAAR/Example/output.king.seg --block.size 500 --max.related.block 500 --num_threads 10' /home/zmli/software/STAAR/FastSparseGRM-main/extdata/calcSparseGRM_wrapper.R calcSparseGRM.Rout

from staarpipeline-tutorial.

xihaoli avatar xihaoli commented on September 25, 2024

Hi @zmli0831,

Thanks for following up. Based on your scripts, I can see two issues here:

(1) The output of FastSparseGRM is already a sparse matrix object, and STAAR supports sparse GRM. Thus, in the null model fitting script, it is unnecessary to use kins=as.matrix(sgrm) as it will then convert the GRM back to a dense matrix, which is computationally expensive. This could be the reason that caused

[1] "kins is a dense matrix, transforming it into a sparse matrix using cutoff 0.022."
Using 39408 samples provided
double free or corruption (!prev)
Aborted (core dumped)

Instead, you can just use kins <- sgrm for null model fitting.

(2) In null model fitting, subjects in the phenotype data determine the final sample size. The sample ids (rownames and colnames) in the sparse GRM should be the same as phenotype or a superset, but not a subset. In your output, your phenotype data include samples that are not in your GRM file, which could the be the reason that caused

Error in glmmkin(fixed = fixed, data = data, kins = kins_sp, id = id, :
Error: kins matrix 1 does not include all individuals in the data.

Hope this helps, and please feel free to close this issue if it has been resolved.

Best,
Xihao

from staarpipeline-tutorial.

zmli0831 avatar zmli0831 commented on September 25, 2024

Thank you very much for your reply, after your reminder, the codes works!!

from staarpipeline-tutorial.

xihaoli avatar xihaoli commented on September 25, 2024

Hi @zmli0831,

Thank you so much for letting me know and great to hear. I shall close this issue for now. Please feel free to open a new issue if you have any other questions.

Best,
Xihao

from staarpipeline-tutorial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.