Skip to content

garageit46/1D-msfs-R

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Calculate 1D-folded SFS from VCF and population.log files of stacks using R

  • This script calculate observed 1D-folded SFS (minor allele frequency spectrum) for stairway plot. https://github.com/xiaoming-liu/stairway-plot-v2
  • It uses stacks output (populations.log and vcf files).
  • Missing data is compensated by a bootstrapping.
  • It outputs basic information and SFS as .csv and .txt files, respectively.

Example

Example for calculation of 1D-folded SFS

    source("r230327calc_sfs.r")
  
    set.seed(46) # Fix random seed
    infile.dir <- "~/works/works16/ibuki/data/stacks/210813VS_Hokkaido/analysis01/" # Path for stacks output directory
    outfile.basic.info <- "basic_info_VS10inds.csv" # output basic information file name
    outfile.sfs <- "observed_SFS_VS10inds.txt" # output 
  
    calc.1d.msfs (infile.dir, outfile.basic.info, outfile.sfs)

About

Calculate 1D-mSFS from VCF and population.log files of stacks using R

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages