tpook92 / HaploBlocker

R-package: Calculation of haplotype blocks and libraries
GNU General Public License v3.0
26 stars 2 forks source link

Subsetting sample from block library #7

Open yan-cheng-lin opened 3 years ago

yan-cheng-lin commented 3 years ago

Hi,

I have constructed the block library based on the genotypic data of ~4000 tomatoes. I want to use plot_block() to draw the graphics only based on subset of samples (~100). Is there any tools available for subsetting samples from the result (blocklist), because the result is a list that is arranged by haplotype blocks.

Thanks for your wonderful package.

Andy Lin

tpook92 commented 3 years ago

Dear Andy,

i just uploaded a new HaploBlocker version (1.5.17) with two new features:

  1. plot_block includes a parameter named import_order which can be used to force the order of the haplotype to be plotted (e.g. import_block = 1:50 will plot the haplotype library but only include the first 50 haplotype blocks). This however will not change the order of haplotype according to local similarity. ((this parameter was include previously but was not working as intendend))

  2. I added the function blocklist_subset. Here you can provide an existing blocklist and a vector as the subset of lines you want to include in the new haplotype library and the output will be a haplotype library only including those lines. Labelling of haplotypes will be changed so the first haplotype of the subset is now haplotype 1 and the last haplotype of the subset is now haplotype (length(subset))

Example for the use of this is: blocklist <- block_calculation(ex_maze) blocklist_sub <- blocklist_subset(blocklist, subset = 25:74) plot_block(blocklist_sub) to get a haplotype library from lines 25 to 74 of the ex_maze dataset.

Best regards Torsten

yan-cheng-lin commented 3 years ago

Dear Torsten,

I'll give it a try.

Thanks

Andy Lin