Skip to content

Commit e66461c

Browse files
committed
update README
1 parent 9a5c947 commit e66461c

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
* Pre-release v0.0.1
1414

15-
## <a name="started"></a>Getting Started
15+
## Getting Started
1616
```sh
1717
git clone --recursive https://github.com/yangao07/longcallD
1818
cd longcallD && make
@@ -26,6 +26,19 @@ man ./longcallD.1
2626
``` -->
2727

2828
## Table of Contents
29+
- [LongcallD: local-haplotagging-based small and structural variant calling](#longcalld-local-haplotagging-based-small-and-structural-variant-calling)
30+
- [Updates (v0.0.1)](#updates-v001)
31+
- [Getting Started](#getting-started)
32+
- [Table of Contents](#table-of-contents)
33+
- [Introduction](#introduction)
34+
- [Installation](#installation)
35+
- [Pre-built binary executable file for Linux/Unix or MacOS (recommended)](#pre-built-binary-executable-file-for-linuxunix-or-macos-recommended)
36+
- [Building longcallD from source files](#building-longcalld-from-source-files)
37+
- [General Usage](#general-usage)
38+
- [Variant calling from HiFi/ONT long reads](#variant-calling-from-hifiont-long-reads)
39+
- [Variant calling and phasing long reads](#variant-calling-and-phasing-long-reads)
40+
- [Variant calling from remote files](#variant-calling-from-remote-files)
41+
- [Contact](#contact)
2942

3043
## Introduction
3144
LongcallD is a local-haplotagging-based small and structural variant (SV) caller using long reads.
@@ -59,17 +72,28 @@ tar -zxvf longcallD-v0.0.1.tar.gz
5972
cd longcallD-v0.0.1; make
6073
```
6174

62-
## General usage
75+
## General Usage
76+
LongcallD takes a reference genome FASTA (can be gzip'd) and a long-read BAM as input
77+
and outputs phased variant calls in a VCF file.
78+
LongcallD seamlessly works with variant calling region(s), in the same way as `samtools view`.
6379
### Variant calling from HiFi/ONT long reads
6480
```
65-
longcallD call -t16 ref.fa hifi.bam --hifi > hifi.vcf # for PacBio HiFi reads
81+
longcallD call -t16 ref.fa hifi.bam > hifi.vcf # for PacBio HiFi reads, --hifi is default
6682
longcallD call -t16 ref.fa ont.bam --ont > ont.vcf # for ONT reads
83+
longcallD call -t16 ref.fa hifi.bam chr11:10,229,956-10,256,221 > hifi_reg.vcf # variant calling in a region
84+
longcallD call -t16 ref.fa hifi.bam chr11:10,229,956-10,256,221 chr12:10,576,356-10,583,438 > hifi_regs.vcf # variant calling in a multiple regions
6785
```
6886
### Variant calling and phasing long reads
6987
```
7088
longcallD call -t16 ref.fa hifi.bam --hifi -b hifi_phased.bam > hifi.vcf # output phased HiFi reads, with BAM tag HP & PS
7189
longcallD call -t16 ref.fa ont.bam --ont -b ont_phased.bam > ont.vcf # output phased ONT reads, with BAM tag HP & PS
7290
```
91+
### Variant calling from remote files
92+
```
93+
ref=https://ftp-trace.ncbi.nlm.nih.gov/ReferenceSamples/giab/release/references/GRCh38/GRCh38_GIABv3_no_alt_analysis_set_maskedGRC_decoys_MAP2K3_KMT2C_KCNJ18.fasta.gz
94+
bam=https://ftp-trace.ncbi.nlm.nih.gov/giab/ftp/data/AshkenazimTrio/HG002_NA24385_son/PacBio_HiFi-Revio_20231031/HG002_PacBio-HiFi-Revio_20231031_48x_GRCh38-GIABv3.bam
95+
longcallD call -t16 $ref $bam chr11:10,229,956-10,256,221 chr12:10,576,356-10,583,438 > hifi_regs.vcf
96+
```
7397

7498
## Contact
7599
Yan Gao yangao@ds.dfci.harvard.edu

src/vcf_utils.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,15 @@ int write_var_to_vcf(var_t *vars, const struct call_var_opt_t *opt, char *chrom)
112112
fprintf(out_vcf, "\t%d\tPASS\tEND=%" PRId64 "", var.QUAL, var.pos + var.ref_len - 1);
113113
if (is_sv) fprintf(out_vcf, ";%s;%s\t", SVTYPE, SVLEN);
114114
else fprintf(out_vcf, "\t");
115-
fprintf(out_vcf, "GT:DP:AD:GQ:PS\t%d|%d:%d:", var.GT[0], var.GT[1], var.DP);
115+
int is_hom = var.GT[0] == var.GT[1] ? 1 : 0;
116+
if (is_hom) fprintf(out_vcf, "GT:DP:AD:GQ\t%d|%d:%d:", var.GT[0], var.GT[1], var.DP);
117+
else fprintf(out_vcf, "GT:DP:AD:GQ:PS\t%d|%d:%d:", var.GT[0], var.GT[1], var.DP);
116118
for (int j = 0; j < 1+var.n_alt_allele; j++) {
117119
if (j > 0) fprintf(out_vcf, ",");
118120
fprintf(out_vcf, "%d", var.AD[j]);
119121
}
120-
fprintf(out_vcf, ":%d:%" PRId64 "\n", var.GQ, var.PS);
122+
if (is_hom) fprintf(out_vcf, ":%d\n", var.GQ);
123+
else fprintf(out_vcf, ":%d:%" PRId64 "\n", var.GQ, var.PS);
121124
}
122125
return ret;
123126
}

0 commit comments

Comments
 (0)