filterLargep.link | R Documentation |
Filter/extract one or multiple gene(s)/range(s) from a large
p.link
file.
filterLargeP.link(
root,
rootOut = rootOut,
Chr = Chr,
POS = NULL,
start = start,
end = end,
override = TRUE,
sep = "\t"
)
root |
The file name without suffix. This function only support p.link file format stored in "map" and "ped" format, the file names after removed suffix should be same with each other. |
rootOut |
Path(s) of output |
Chr |
a single CHROM name or CHROM names vector. |
POS , start , end |
provide the chromosome name should be extract from orignal p.link dataset.
|
override |
whether override existed file or not, default as |
sep |
a character indicate the separation of map and ped file, default is |
This package import P.link files. However, import a large P.link file is time and
memory consuming. It's suggested that extract variants in target
range with filterLargeP.link()
before identification of haplotype.
When filter/extract multi genes/ranges, the parameter of Chr
and POS
must have equal length. Results will save to a single file if the user
provide a single file path or save to multiple P.link file(s) when a equal length
vector consist with file paths is provided.
No return value
# The filteration of P.link of regular size should be done with `filter_plink.pedmap()`.
# however, here, we use a mini vcf instead just for example and test
pedfile <- system.file("extdata",
"snp3kvars-CHR8-25947258-25951166-plink.ped",
package = "geneHapR")
mapfile <- system.file("extdata",
"snp3kvars-CHR8-25947258-25951166-plink.map",
package = "geneHapR")
oldDir <- getwd()
temp_dir <- tempdir()
if(! dir.exists(temp_dir))
dir.create(temp_dir)
setwd(temp_dir)
file.copy(pedfile, "test.ped")
file.copy(mapfile, "test.map")
# extract a single gene/range from large vcf
filterLargeP.link(root = "test",
rootOut = "filtered_test",
Chr = "scaffold_1", POS = c(4300,5000), override = TRUE)
setwd(oldDir)
# delete temp_dir
unlink(temp_dir, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.