Skip to content

Commit 9caf614

Browse files
Michele BerselliMichele Berselli
authored andcommitted
novoCaller triofiles order change, comHet can deal with more than 3 sample in trio argument
1 parent 688b358 commit 9caf614

File tree

11 files changed

+45
-28
lines changed

11 files changed

+45
-28
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ For more details, see granite [*documentation*](https://granite-suite.readthedoc
1111
## Availability and requirements
1212
A ready-to-use docker image is available to download.
1313

14-
docker pull b3rse/granite:v0.1.11
14+
docker pull b3rse/granite:v0.1.12
1515

1616
To run locally, install the following libraries:
1717

@@ -156,3 +156,7 @@ rckTar creates a tar archive from bgzip and tabix indexed RCK files. Creates an
156156

157157
### validateVCF
158158
validateVCF allows to calculate error models for different inheritance modes for input VCF file using pedigree information.
159+
160+
## WARNINGS
161+
162+
!! starting from 0.1.12, novoCaller `--triofiles` expected order changed. Now PROBAND must be listed as first.

docs/callers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ novoCaller is a Bayesian calling algorithm for *de novo* mutations. The model us
2222
bgzip and tabix indexed RCK)
2323
-t TRIOFILES, --triofiles TRIOFILES
2424
TSV index file containing SampleID<TAB>Path/to/file
25-
for family files, the PROBAND must be listed as LAST
25+
for family files, the PROBAND must be listed as FIRST
2626
(BAM or bgzip and tabix indexed RCK)
2727
--ppthr PPTHR threshold to filter by posterior probabilty for de
2828
novo calls (>=) [0]

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Michele Berselli'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '0.1.11'
25+
release = '0.1.12'
2626

2727

2828
# -- General configuration ---------------------------------------------------

docs/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A ready-to-use docker image is available to download.
44

5-
docker pull b3rse/granite:v0.1.11
5+
docker pull b3rse/granite:v0.1.12
66

77
To run locally, Python 3.6+ is required together with the following libraries:
88

granite/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Version information."""
22

33
# The following line *must* be the last in the module, exactly as formatted:
4-
__version__ = "0.1.11"
4+
__version__ = "0.1.12"

granite/comHet.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,12 @@ def main(args, test=False):
616616
#end if
617617

618618
# Get trio IDs
619-
if len(args['trio']) > 3:
620-
sys.exit('\nERROR in parsing arguments: too many sample IDs provided for trio\n')
621-
elif len(args['trio']) == 3:
619+
# if len(args['trio']) > 3:
620+
# sys.exit('\nERROR in parsing arguments: too many sample IDs provided for trio\n')
621+
if len(args['trio']) == 3:
622622
is_family = True
623623
#end if
624-
ID_list = args['trio'] # [proband_ID, parent_ID, parent_ID]
624+
ID_list = args['trio'][:3] # [proband_ID, parent_ID, parent_ID]
625625

626626
# Reading variants
627627
analyzed = 0

granite/granite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def main():
5656
novoCaller_parser.add_argument('-i', '--inputfile', help='input VCF file', type=str, required=True)
5757
novoCaller_parser.add_argument('-o', '--outputfile', help='output file to write results as VCF, use .vcf as extension', type=str, required=True)
5858
novoCaller_parser.add_argument('-u', '--unrelatedfiles', help='TSV index file containing SampleID<TAB>Path/to/file for unrelated files used to train the model (BAM or bgzip and tabix indexed RCK)', type=str, required=True)
59-
novoCaller_parser.add_argument('-t', '--triofiles', help='TSV index file containing SampleID<TAB>Path/to/file for family files, the PROBAND must be listed as LAST (BAM or bgzip and tabix indexed RCK)', type=str, required=True)
59+
novoCaller_parser.add_argument('-t', '--triofiles', help='TSV index file containing SampleID<TAB>Path/to/file for family files, the PROBAND must be listed as FIRST (BAM or bgzip and tabix indexed RCK)', type=str, required=True)
6060
novoCaller_parser.add_argument('--ppthr', help='threshold to filter by posterior probabilty for de novo calls (>=) [0]', type=float, required=False)
6161
novoCaller_parser.add_argument('--afthr', help='threshold to filter by population allele frequency (<=) [1]', type=float, required=False)
6262
novoCaller_parser.add_argument('--afthr_unrelated', help='threshold to filter by allele frequency calculated among unrelated (<=) [1]', type=float, required=False)

granite/novoCaller.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,12 +843,24 @@ def main(args, test=False):
843843

844844
if is_bam: # if bam files
845845
unrelated_files, IDs_unrelated = buffering_bams(args['unrelatedfiles'])
846-
trio_files, IDs_trio = buffering_bams(args['triofiles']) # [parent, parent, child]
846+
trio_files, IDs_trio = buffering_bams(args['triofiles'])
847847
else:
848848
unrelated_files, IDs_unrelated = buffering_rcks(args['unrelatedfiles'])
849-
trio_files, IDs_trio = buffering_rcks(args['triofiles']) # [parent, parent, child]
849+
trio_files, IDs_trio = buffering_rcks(args['triofiles'])
850850
#end if
851851

852+
# !!!
853+
# Subset trio_files and IDs_trio to exclude additional family members
854+
trio_files = trio_files[:3]
855+
IDs_trio = IDs_trio[:3]
856+
# Sorting trio_files and IDs_trio to have proband last
857+
# [child, parent, parent] this is as it is expected in the input file
858+
# the code expect instead [parent, parent, child]
859+
# we need to put child at the end
860+
trio_files.append(trio_files.pop(0))
861+
IDs_trio.append(IDs_trio.pop(0))
862+
# !!!
863+
852864
# Checking info files for trio is complete
853865
if len(trio_files) != 3:
854866
sys.exit('\nERROR in BAMs info file for trio: missing information for some family member\n')

tests/files/trio_bam.tsv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
HG002 tests/files/bam/HG002.hs37d5.60x.1.addrg_sorted.bam_regions.bam
12
HG003 tests/files/bam/HG003.hs37d5.60x.1.addrg_sorted.bam_regions.bam
23
HG004 tests/files/bam/HG004.hs37d5.60x.1.addrg_sorted.bam_regions.bam
3-
HG002 tests/files/bam/HG002.hs37d5.60x.1.addrg_sorted.bam_regions.bam
4+
HG003 tests/files/bam/HG003.hs37d5.60x.1.addrg_sorted.bam_regions.bam

tests/files/trio_rck.tsv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1+
UDN930725 tests/files/rck/GAPFIZWAW2KS_mpileup.out.gz_120Kbp.rck.gz
12
MOM tests/files/rck/GAPFIXRIG4PE_mpileup.out.gz_120Kbp.rck.gz
23
DAD tests/files/rck/GAPFIYDBF875_mpileup.out.gz_120Kbp.rck.gz
3-
UDN930725 tests/files/rck/GAPFIZWAW2KS_mpileup.out.gz_120Kbp.rck.gz

0 commit comments

Comments
 (0)