Using the attached file, please provide a code that calculates the following:
-
Calculate minor allele frequency (MAF; definition shown in 1a) for each SNP. a. MAF = minimum(reference allele frequency, alternate allele frequency) Reference (or Alternate) allele frequency is defined by reference (or alternate) allele counts divided by the sum of reference and alternate allele counts for a given SNP. b. Code should print “SNPname” list and its corresponding MAF. E.g. SNPname MAF SNP1 0.073 SNP10 0.000
-
Calculate the number of SNPs that has a minor allele frequency between 0.02 and 0.3. i.e., 0.02 <= MAF <= 0.3 a. Code should print out the file name and the number of SNPs matching the criterion.
The code could be one big code accomplishing both tasks or two separate codes for each task. If you can think of a command line one-liner bash script that would do each task, we would love to see it.