Skip to content

Commit

Permalink
new feature for multiple popnames
Browse files Browse the repository at this point in the history
  • Loading branch information
stschiff committed Mar 1, 2024
1 parent e8ae3bd commit 5b90aad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

- V 1.5.4.0:
- updated sequence-formats dependency allows more lenient parsing of pileup-data, now also allowing for arbitrary reference alleles (not just ACTGN). This won't affect calling (sites where the pileup-reference is something different from the SNP-file input are declared missing), but will be less disruptive when parsing pileup-input.
- improved error output for parsing problems with pileup-format data. Now only a small part of the problematic chunk is output, hopefully easing error interpretation in such cases
- output a useful error message if the number of samples passed in --sampleNames is inconsistent with the pileup-input
- `--samplePopName` now accepts multiple pop-names, separated by comma. The number of pop-names must then match the number of samples.
- V 1.5.3.2: fixed a bug in vcf2eigenstrat that would fail on VCFs with missing Quality values.
- V 1.5.3.1: updated to latest GHC pedantic compilation
- V 1.5.3: Upgraded to sequence-formats 1.7.0 introducing an option for plink popName encoding, and improved pileup-Parsing to allow for skip-reference characters
Expand Down
2 changes: 1 addition & 1 deletion sequenceTools.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sequenceTools
version: 1.5.3.2
version: 1.5.4.0
synopsis: A package with tools for processing DNA sequencing data
description: The tools in this package process sequencing Data, in particular from ancient DNA sequencing libraries. Key tool in this package is pileupCaller, a tool to randomly sample genotypes from sequencing data.
license: GPL-3
Expand Down
6 changes: 3 additions & 3 deletions src-executables/pileupCaller.hs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ runMain = do
FreqSumFormat -> outputFreqSum freqSumProducer
EigenstratFormat outPrefix -> outputEigenStratOrPlink outPrefix popNames Nothing freqSumProducer
PlinkFormat outPrefix popNameMode -> outputEigenStratOrPlink outPrefix popNames (Just popNameMode) freqSumProducer
--outputStats
outputStats

pileupToFreqSum :: Producer PileupRow (SafeT IO) () -> App (Producer FreqSumEntry (SafeT IO) ())
pileupToFreqSum pileupProducer = do
Expand Down Expand Up @@ -304,8 +304,8 @@ addOneSite readStats = modifyIORef' (rsTotalSites readStats) (+1)

updateStatsAllSamples :: ReadStats -> [Int] -> [Int] -> [Int] -> IO ()
updateStatsAllSamples readStats rawBaseCounts damageCleanedBaseCounts congruencyCleanedBaseCounts = do
let n = V.length (rsRawReads readStats)
when (length rawBaseCounts /= n) $
let nSamples = V.length (rsRawReads readStats)
when (length rawBaseCounts /= nSamples) $
throwIO (UserInputException "number of individuals specified differs from number of individuals in the pileup input")
sequence_ [V.modify (rsRawReads readStats) (+n) i | (i, n) <- zip [0..] rawBaseCounts]
sequence_ [V.modify (rsReadsCleanedSS readStats) (+n) i | (i, n) <- zip [0..] damageCleanedBaseCounts]
Expand Down
2 changes: 1 addition & 1 deletion src-executables/vcf2eigenstrat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import SequenceFormats.VCF (readVCFfromStdIn, VCFheader(..), VCFentry(..),
isBiallelicSnp, getDosages, vcfToFreqSumEntry)
import SequenceFormats.Eigenstrat (EigenstratSnpEntry(..), readEigenstratSnpFile, writeEigenstrat,
Sex(..), EigenstratIndEntry(..))
import SequenceFormats.FreqSum (FreqSumEntry(..), freqSumEntryToText)
import SequenceFormats.FreqSum (FreqSumEntry(..))

import SequenceTools.Utils (versionInfoText, versionInfoOpt, freqSumToEigenstrat)

Expand Down

0 comments on commit 5b90aad

Please sign in to comment.