You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a follow-up to my last issue, it's quite cumbersome to construct VCF or BED files for each phenotype separately, so the best way to go on would be probably to use the covrowinds and geneticrowinds argument to select only the samples used in the current analysis. As I'm by no means an expert in Julia, how would one go on to implement this, similar to the snpinds argument which works very nicely. Is there any easy way to construct the covrowinds and geneticrowinds using IDs of participants? Or does one have to construct the indices manually? What is the syntax of the indices?`
Any pointers on this would be highly appreciated
The text was updated successfully, but these errors were encountered:
using BGEN
genetic_iids_subsample =# a list of sample names here
data =Bgen(bgenfilename *".bgen"; sample_path = samplefilename)
genetic_iids =samples(data) # assuming sample names are `String`s directly mapped to individual IDs.
order_dict =Dict{String, Int}() # creating an empty dictionary with key type String, value type Int.for (i, iid) inenumerate(genetic_iids)
order_dict[iid] = i
end
sample_indicator =falses(length(genetic_iids))
for v in genetic_iids_subsample
sample_indicator[order_dict[v]] =trueend# then use sample_indicator as `geneticrowinds`
You can do the similar with the SNP's RefSeq IDs when constructing snpinds.
It would be a nice feature to have in our package, but it is tricky since it depends on the files you have, as you can see in the example that I linked.
As a follow-up to my last issue, it's quite cumbersome to construct VCF or BED files for each phenotype separately, so the best way to go on would be probably to use the covrowinds and geneticrowinds argument to select only the samples used in the current analysis. As I'm by no means an expert in Julia, how would one go on to implement this, similar to the snpinds argument which works very nicely. Is there any easy way to construct the covrowinds and geneticrowinds using IDs of participants? Or does one have to construct the indices manually? What is the syntax of the indices?`
Any pointers on this would be highly appreciated
The text was updated successfully, but these errors were encountered: