Skip to content

Commit

Permalink
bioinfo/Samtools: added faidx
Browse files Browse the repository at this point in the history
  • Loading branch information
pveber committed Oct 29, 2019
1 parent 42ac2d6 commit be01609
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/bioinfo/bistro_bioinfo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ class type fasta = object
method format : [`fasta]
end

class type indexed_fasta = object
inherit directory
method contents : [`indexed_fasta]
end

class type fastq = object
inherit text_file
method format : [`fastq]
Expand Down Expand Up @@ -344,6 +349,15 @@ module Samtools = struct
opt "-o" Fn.id dest ;
]
]

let faidx fa =
Workflow.shell ~descr:"samtools.faidx" [
mkdir_p dest ;
cmd "cp" [ dep fa ; dest // "sequences.fa" ] ;
samtools "faidx" [ dest // "sequences.fa" ] ;
]

let fasta_of_indexed_fasta dir = Workflow.select dir ["sequences.fa"]
end

module Bowtie2 = struct
Expand Down
11 changes: 11 additions & 0 deletions lib/bioinfo/bistro_bioinfo.mli
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class type fasta = object
method format : [`fasta]
end

class type indexed_fasta = object
inherit directory
method contents : [`indexed_fasta]
end

class type fastq = object
inherit text_file
method format : [`fastq]
Expand Down Expand Up @@ -650,6 +655,12 @@ module Samtools : sig
< file_kind : [`regular] ;
format : [< `bam | `sam] ; .. > pworkflow ->
'o pworkflow

val faidx :
fasta pworkflow -> indexed_fasta pworkflow

val fasta_of_indexed_fasta :
indexed_fasta pworkflow -> fasta pworkflow
end

module Picardtools : sig
Expand Down

0 comments on commit be01609

Please sign in to comment.