Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions bin/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,29 @@
# 1 ranked B*35:08:01 (abundance: 50.20%)

lines = IO.readlines(hisat)
header = lines.shift.split("\t")

lines.each do |l|
info = lines.shift.split("\t")

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

hla_call = line.strip.split(" ")[2]
hla_gene = hla_call.split("*")[0]

next unless alleles.has_key?(hla_gene)

alleles[hla_gene]["Hisat"] << hla_gene
header.each_with_index do |h,i|
if h.include?("EM: A")
tmp = info[i]
tmp.split(",").each do |t|
alleles["A"]["Hisat"] << t.split(" ")[0]
end
elsif h.include?("EM: B")
tmp = info[i]
tmp.split(",").each do |t|
alleles["B"]["Hisat"] << t.split(" ")[0]
end
elsif h.include?("EM: C")
tmp = info[i]
tmp.split(",").each do |t|
alleles["C"]["Hisat"] << t.split(" ")[0]
end
end

end

end
Expand Down Expand Up @@ -156,7 +167,7 @@
results = []
results << [ "Allele", "xHLA (Nicht-kommerziell)", "Hisat", "Optitype" ]
alleles.keys.each do |k|
results << [ k, alleles[k]["xHLA"].join(", "), "", alleles[k]["Optitype"].join(", ") ]
results << [ k, alleles[k]["xHLA"].sort.join(", "), alleles[k]["Hisat"].sort.join(", "), alleles[k]["Optitype"].sort.join(", ") ]
end

t = pdf.make_table(
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
params {
samples = "https://raw.githubusercontent.com/ikmb/nf-testdata/master/hla/samples.csv"
tools = 'xhla,optitype'
tools = 'xhla,optitype,hisat'
run_name = "Testrun"
}
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ patientID;sampleID;libraryID;rgID;R1;R2
PatientA;Sample1;22Oct21_S3;C41232CXX.1.22Oct21_S3;/path/to/R1.fastq.gz;/path/to/R2.fastq.gz
```

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

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

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

### `--run_name`
Expand Down
2 changes: 1 addition & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ multiqc_report = Channel.from([])

log.info "IKMB HLA Pipeline"
log.info "${workflow.manifest.description} v${params.version}"
log.info "Nextflow Version: $workflow.nextflow.version"
log.info "Nextflow Version: $workflow.nextflow.version"
log.info "Tools requested: ${params.tools}"
log.info "------------------------------------------"

Expand Down
6 changes: 5 additions & 1 deletion modules/hisat/report.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
process HISAT_REPORT {

tag "${meta.patient_id}|${meta.sample_id}"

publishDir "${params.outdir}/${meta.patient_id}/${meta.sample_id}", mode: 'copy'

input:
tuple val(meta),path(result)

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

"""
hisatgenotype_toolkit parse-results --csv --in-dir $result > $report
hisatgenotype_toolkit parse-results --csv --in-dir $result --output-file $report
"""

}
2 changes: 2 additions & 0 deletions modules/reporting.nf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
process REPORT {

tag "${meta.patient_id}|${meta.sample_id}"

publishDir "${params.outdir}/${meta.patient_id}/${meta.sample_id}", mode: 'copy'

input:
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dag {
file = "${params.outdir}/pipeline_info/pipeline_dag.svg"
}

process.container = 'ikmb/hla:devel'
process.container = 'ikmb/hla:1.0'

profiles {
standard {
Expand Down
2 changes: 1 addition & 1 deletion subworkflows/hisat.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include { HISAT_GENOTYPE } from "./../modules/hisat/genotype"
include { HISAT_REPORT } from "./../modules/hisat/report"

include { FASTQ_MERGE } from "./../modules/fastq_merge"

workflow HISAT_TYPING {

Expand Down