Skip to content

Commit 275a00b

Browse files
authored
Merge pull request #2 from ikmb/devel
Triggering release
2 parents b32d398 + 8ec6c3b commit 275a00b

File tree

8 files changed

+33
-16
lines changed

8 files changed

+33
-16
lines changed

bin/report.rb

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,29 @@
110110
# 1 ranked B*35:08:01 (abundance: 50.20%)
111111

112112
lines = IO.readlines(hisat)
113+
header = lines.shift.split("\t")
113114

114-
lines.each do |l|
115+
info = lines.shift.split("\t")
115116

116-
if line.include?("1 ranked") or line.include?("2 ranked")
117117

118-
hla_call = line.strip.split(" ")[2]
119-
hla_gene = hla_call.split("*")[0]
120-
121-
next unless alleles.has_key?(hla_gene)
122-
123-
alleles[hla_gene]["Hisat"] << hla_gene
118+
header.each_with_index do |h,i|
119+
if h.include?("EM: A")
120+
tmp = info[i]
121+
tmp.split(",").each do |t|
122+
alleles["A"]["Hisat"] << t.split(" ")[0]
123+
end
124+
elsif h.include?("EM: B")
125+
tmp = info[i]
126+
tmp.split(",").each do |t|
127+
alleles["B"]["Hisat"] << t.split(" ")[0]
128+
end
129+
elsif h.include?("EM: C")
130+
tmp = info[i]
131+
tmp.split(",").each do |t|
132+
alleles["C"]["Hisat"] << t.split(" ")[0]
133+
end
124134
end
135+
125136
end
126137

127138
end
@@ -156,7 +167,7 @@
156167
results = []
157168
results << [ "Allele", "xHLA (Nicht-kommerziell)", "Hisat", "Optitype" ]
158169
alleles.keys.each do |k|
159-
results << [ k, alleles[k]["xHLA"].join(", "), "", alleles[k]["Optitype"].join(", ") ]
170+
results << [ k, alleles[k]["xHLA"].sort.join(", "), alleles[k]["Hisat"].sort.join(", "), alleles[k]["Optitype"].sort.join(", ") ]
160171
end
161172

162173
t = pdf.make_table(

conf/test.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
params {
22
samples = "https://raw.githubusercontent.com/ikmb/nf-testdata/master/hla/samples.csv"
3-
tools = 'xhla,optitype'
3+
tools = 'xhla,optitype,hisat'
44
run_name = "Testrun"
55
}

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ patientID;sampleID;libraryID;rgID;R1;R2
2323
PatientA;Sample1;22Oct21_S3;C41232CXX.1.22Oct21_S3;/path/to/R1.fastq.gz;/path/to/R2.fastq.gz
2424
```
2525

26-
This is the preffered input option as it provide more control over the naming and grouping of the data.
26+
This is the preferred input option as it provide more control over the naming and grouping of the data.
2727

2828
A simple ruby script is included with this pipeline to produce this file from a folder of FastQ files. However, please check
2929
the output to make sure that it correctly recognized the file names etc.
@@ -65,7 +65,7 @@ nextflow run ikmb/hla --samples Samples.csv --tools 'hisat,xhla,optitype'
6565
Supported tools:
6666

6767
* [xHLA](https://github.com/humanlongevity/HLA) (xhla)
68-
* [Hisat-genotype](https://daehwankimlab.github.io/hisat-genotype/) (hisat)
68+
* [Hisat-genotype](https://daehwankimlab.github.io/hisat-genotype/) (hisat) SLOW!!
6969
* [Optitype](https://github.com/FRED-2/OptiType) (optitype)
7070

7171
### `--run_name`

main.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ multiqc_report = Channel.from([])
3434

3535
log.info "IKMB HLA Pipeline"
3636
log.info "${workflow.manifest.description} v${params.version}"
37-
log.info "Nextflow Version: $workflow.nextflow.version"
37+
log.info "Nextflow Version: $workflow.nextflow.version"
3838
log.info "Tools requested: ${params.tools}"
3939
log.info "------------------------------------------"
4040

modules/hisat/report.nf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
process HISAT_REPORT {
22

3+
tag "${meta.patient_id}|${meta.sample_id}"
4+
5+
publishDir "${params.outdir}/${meta.patient_id}/${meta.sample_id}", mode: 'copy'
6+
37
input:
48
tuple val(meta),path(result)
59

@@ -11,7 +15,7 @@ process HISAT_REPORT {
1115
report = "${meta.patient_id}_${meta.sample_id}.hisat.tsv"
1216

1317
"""
14-
hisatgenotype_toolkit parse-results --csv --in-dir $result > $report
18+
hisatgenotype_toolkit parse-results --csv --in-dir $result --output-file $report
1519
"""
1620

1721
}

modules/reporting.nf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
process REPORT {
22

3+
tag "${meta.patient_id}|${meta.sample_id}"
4+
35
publishDir "${params.outdir}/${meta.patient_id}/${meta.sample_id}", mode: 'copy'
46

57
input:

nextflow.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ dag {
5353
file = "${params.outdir}/pipeline_info/pipeline_dag.svg"
5454
}
5555

56-
process.container = 'ikmb/hla:devel'
56+
process.container = 'ikmb/hla:1.0'
5757

5858
profiles {
5959
standard {

subworkflows/hisat.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include { HISAT_GENOTYPE } from "./../modules/hisat/genotype"
22
include { HISAT_REPORT } from "./../modules/hisat/report"
3-
3+
include { FASTQ_MERGE } from "./../modules/fastq_merge"
44

55
workflow HISAT_TYPING {
66

0 commit comments

Comments
 (0)