<commit_before># THIS SCRIPT WAS PRODUCED VIA THE NCBI HACKATHON IN AUGUST 2015 
# WRITTEN (INITIALLY) BY <NAME>, <NAME>, <NAME>, AND <NAME>


# TO DO - UPDATE TO SUBREAD PACKAGE (for counting) INSTEAD OF HTSEQ (TOO SLOW, SUBREAD SUPER FAST)



#OUTPUT LOCATIONS
#working directory for now 
S3_BUCKET='s3://genomicdata/hassl/'
WORKING_DIR="/mnt/SRP050499/"


# HISATREF="/home/ubuntu/resources/ensembl/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
HISATREF="/mnt/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"

#GFFFILE = "/home/ubuntu/refs/GCF_000001405.30_GRCh38.ens77_genomic.gff"
PICARDFLATFILE="/home/ubuntu/resources/ensembl/GRCh38.77.compatible.ucsc.picard.refflat.txt"
GTFFILE="/home/ubuntu/resources/ensembl/Ensembl.GRCh38.77.gtf"
SPLICEFILE="/home/ubuntu/resources/ensembl/Ensembl.GRCh38.77.splicesites.txt"
#set the number of threads to use in alignments 
THREADS=5

#set the filename of the file with the list of accessions   

filename = config["ACCESSION_FILE"]



# EXECUTABLE LOCATIONS (some on path)
HISAT=" /home/ubuntu/install/hisat/hisat "
PICARD=" java -jar /home/ubuntu/install/picard-tools-1.138/picard.jar "
FEATURECOUNTS="/home/ubuntu/install/subread-1.4.6-p4-Linux-x86_64/bin/featureCounts"
#HTSEQ=" ~/HTSeq-0.6.1/build/scripts-2.7/htseq-count "

SAMTOOLS=" /home/ubuntu/install/samtools_rocksdb/samtools/samtools "

SAMPLES_FROM_FILE = [line.rstrip('\n') for line in open(filename)]
SAMPLES = [s for s in SAMPLES_FROM_FILE if s]

rule all: 
  input: expand("{sample}.GRCh38.ens77.featureCounts.counts", sample=SAMPLES)  #, expand("{sample}.qc_check.done", sample=SAMPLES)

rule all_on_s3: 
  input: expand("{S3_BUCKET}/{sample}.GRCh38.ens77.featureCounts.counts", sample=SAMPLES, S3_BUCKET=S3_BUCKET)  #, expand("{sample}.qc_check.done", sample=SAMPLES)

# input: expand("{sample}.GRCh38.ens77.HTSeq.counts", sample=SAMPLES)


rule clean: 
  shell: "rm -fr SRR*; rm log/SRR* "



rule transfer_to_s3: 
  output: "{S3_BUCKET}/{file}"
  input: "{file}"
  log: "log/{file}.xfer.to.s3.log"
  message: "transferring {file} to S3 Bucket {S3_BUCKET}  ->  {S3_BUCKET}/{file}"
  shell: "s3cmd put {wildcards.file} {S3_BUCKET}/{file}"

# rule perform_counting: 
#   output: "{sample}.GRCh38.ens77.HTSeq.counts"
#   input: "{sample}.GRCh38.ens77.hisat.sorted.bam.bai"
#   log: "log/{wildcards.sample}.counting.log"<commit_msg>hassl.snake<commit_after># THIS SCRIPT WAS PRODUCED VIA THE NCBI HACKATHON IN AUGUST 2015 
# WRITTEN (INITIALLY) BY <NAME>, <NAME>, <NAME>, AND <NAME>


# TO DO - UPDATE TO SUBREAD PACKAGE (for counting) INSTEAD OF HTSEQ (TOO SLOW, SUBREAD SUPER FAST)



#OUTPUT LOCATIONS
#working directory for now 
S3_BUCKET='s3://genomicdata/hassl/'
WORKING_DIR="/mnt/SRP050499/"


# HISATREF="/home/ubuntu/resources/ensembl/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
HISATREF="/mnt/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"

#GFFFILE = "/home/ubuntu/refs/GCF_000001405.30_GRCh38.ens77_genomic.gff"
PICARDFLATFILE="/home/ubuntu/resources/ensembl/GRCh38.77.compatible.ucsc.picard.refflat.txt"
GTFFILE="/home/ubuntu/resources/ensembl/Ensembl.GRCh38.77.gtf"
SPLICEFILE="/home/ubuntu/resources/ensembl/Ensembl.GRCh38.77.splicesites.txt"
#set the number of threads to use in alignments 
THREADS=5

#set the filename of the file with the list of accessions   

filename = config["ACCESSION_FILE"]



# EXECUTABLE LOCATIONS (some on path)
HISAT=" /home/ubuntu/install/hisat/hisat "
PICARD=" java -jar /home/ubuntu/install/picard-tools-1.138/picard.jar "
FEATURECOUNTS="/home/ubuntu/install/subread-1.4.6-p4-Linux-x86_64/bin/featureCounts"
#HTSEQ=" ~/HTSeq-0.6.1/build/scripts-2.7/htseq-count "

SAMTOOLS=" /home/ubuntu/install/samtools_rocksdb/samtools/samtools "

SAMPLES_FROM_FILE = [line.rstrip('\n') for line in open(filename)]
SAMPLES = [s for s in SAMPLES_FROM_FILE if s]

rule all: 
  input: expand("{sample}.GRCh38.ens77.featureCounts.counts", sample=SAMPLES)  #, expand("{sample}.qc_check.done", sample=SAMPLES)

# rule all_on_s3: 
#   input: expand("{S3_BUCKET}/{sample}.GRCh38.ens77.featureCounts.counts", sample=SAMPLES, S3_BUCKET=S3_BUCKET)  #, expand("{sample}.qc_check.done", sample=SAMPLES)

# input: expand("{sample}.GRCh38.ens77.HTSeq.counts", sample=SAMPLES)


rule clean: 
  shell: "rm -fr SRR*; rm log/SRR* "



# rule transfer_to_s3: 
#   output: "{S3_BUCKET}/{file}"
#   input: "{file}"
#   log: "log/{file}.xfer.to.s3.log"
#   message: "transferring {file} to S3 Bucket {S3_BUCKET}  ->  {S3_BUCKET}/{file}"
#   shell: "s3cmd put {wildcards.file} {S3_BUCKET}/{file}"

# rule perform_counting: 
#   output: "{sample}.GRCh38.ens77.HTSeq.counts"
#   input: "{sample}.GRCh38.ens77.hisat.sorted.bam.bai"
#   log: "log/{wildcards.sample}.counting.log"
{'fraction_non_alphanumeric': 0.15454931972789115, 'fraction_numerical': 0.039540816326530615, 'mean_word_length': 5.001275510204081, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6674016', 'n_tokens_mistral': 2100, 'n_tokens_neox': 1935, 'n_words': 317}