apriha / lineage

tools for genetic genealogy and the analysis of consumer DNA test results

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to reassemble Kit from specified fragments of other kits.

ebacherdom opened this issue · comments

User story:
I am a researcher with one of two grandparents, and four full siblings in my parents generation and I am attempting to recreate the missing Grandparent's DNA kit. Following established protocols documented in Athey et al's work, I have used patterns of inheritence to isolate sections of chromosomes from 6 different individuals that I would like to assemble into a single coherent kit that I can upload to Gedmatch.

#function to clip SNP fragments
Def Clip(Input_Name, Chromosome, Start, End)

in this quick example, userPW and userJW have already been phased, and are haploid in nature at this point in the analysis.

clip1 = Clip(userPW, 1, 100000, 250000)

#clip2 = Clip(userJW, 1, 5000000,7500000)

Def Assemble(x, y, z)
#haploid_assembled = Assemble(clip1, clip2)
#Makes single sided assembly from individual Clips
#Optionally returns Diploid assembly with duplicated haploid data.

I ended up doing this with simple functions in PETL, probably not worthy of wrapping and including. Here is an example from Chromosome 9 of how I did it:

clip9a_1 = petl.select(PE_A, "{CHROMOSOME} == 9 and {POSITION} < 9000000")
clip9a_2 = petl.select(DW_A, "{CHROMOSOME} == 9 and {POSITION} > 9000000 and {POSITION} < 98000000")
clip9a_3 = petl.select(PE_A, "{CHROMOSOME} == 9 and {POSITION} > 98000000")
Chromosome_9a = petl.cat(clip9a_1, clip9a_2, clip9a_3)