Commit 5020dc5a authored by Eric CHARPENTIER's avatar Eric CHARPENTIER 🐍
Browse files

updated library-type specification

parent 2abaac55
......@@ -86,6 +86,14 @@ GENOMEDIR=config["reference"]["STARindexDir"]
FWADAPT=config["cutadapt-forward"]
RVADAPT=config["cutadapt-reverse"]
## htseq parameter according to library type
if(config["library-type"] == "unstranded"):
HTSEQPARAM = "no"
elif(config["library-type"] == "first-strand"):
HTSEQPARAM = "reverse"
else:
HTSEQPARAM = "yes"
## Overhang calculation for the generation of the reference files in STAR
OVERHANG = int(config["read-length"]) - 1
......@@ -231,17 +239,8 @@ rule createBamIndex:
rule htseq:
input: OUTPUTDIR+"/Samples/{sampleName}/STAR/{sampleName}Aligned.sortedByCoord.out.bam"
output: OUTPUTDIR+"/DESEQ2/counts/{sampleName}"
params: library_type=config["library-type"]
shell: """
if [ {params.library_type} = "reverse" ]
then
htseq-count -r pos -s reverse -f bam {input} {GTF} > {output}
elif [ {params.library_type} = "yes" ]
then
htseq-count -r pos -s yes -f bam {input} {GTF} > {output}
else
htseq-count -r pos -s no -f bam {input} {GTF} > {output}
fi
htseq-count -r pos -s {HTSEQPARAM} -f bam {input} {GTF} > {output}
"""
rule makeBedFromGtf:
......
......@@ -16,7 +16,7 @@ parser.add_argument('-s', '--samplesheet', metavar='FILE', help='Tab delimited f
parser.add_argument('-w', '--workdir', metavar='DIR', help='Analysis working directory. Default: current directory', default='Results', dest='workdir')
parser.add_argument('-r', '--reference-name', metavar='NAME', help='Reference name. This name must match a key in the CONFIG/references.json file. If not used, you will have to write the reference object yourself in the config.json file', dest='referencename', required=False)
parser.add_argument('-c', '--comparisons', metavar='FILE', help='Tab delimited file with no headers indicating which conditions to compare during differential expression analysis. Columns must be "condition1 condition2". (REQUIRED)', type=argparse.FileType('rt'), required=True, dest='conditions')
parser.add_argument('-t', '--librarytype', choices=['yes','no','reverse'] ,help='Library type. If you have no idea what this is, please see "https://chipster.csc.fi/manual/library-type-summary.html"',required=True, dest='librarytype')
parser.add_argument('-t', '--librarytype', choices=['unstranded','first-strand','second-strand'] ,help='Library type. If you have no idea what this is, please see "https://chipster.csc.fi/manual/library-type-summary.html"',required=True, dest='librarytype')
parser.add_argument('-l', '--readlength', metavar='N', type=int, help='Length of the reads.', default=100, required=False, dest='readlength')
parser.add_argument('-n', '--projectname', help='Project name which will appear in html report.', default="RNAseq project", required=False, dest='projectname')
parser.add_argument('-p', '--project', metavar='FILE', help='project.json file generated by illuminadir.jar. (REQUIRED)', required=True, dest='projectjson')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment