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


import os 


# HISATREF="/home/ubuntu/resources/ensembl/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
HISATREF="/mnt/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
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

# 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"
SAMTOOLS=" /home/ubuntu/install/samtools_rocksdb/samtools/samtools "


#set the filename of the file with the list of accessions   
if config["ACCESSION_FILE"]:
  filename = config["ACCESSION_FILE"]
else:
  filename = "ACCESSIONS"

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

if config["WORKING_DIR"]:
  WORKING_DIR=config["WORKING_DIR"]
else: 
  WORKING_DIR=os.getcwd()



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)


rule clean: 
  shell: "rm -fr log qc bams counts  "



rule project_counts:
  output: "project.featureCounts"
  input: GTFFILE, expand("bams/{sample}.GRCh38.ens77.hisat.sorted.bam", sample=SAMPLES)
  log: "log/project.featureCounting"
  threads: THREADS <commit_msg>hassl.snake<commit_after># THIS SCRIPT WAS PRODUCED VIA THE NCBI HACKATHON IN AUGUST 2015 
# WRITTEN BY <NAME>, <NAME>, <NAME>, AND <NAME>


import os 


# HISATREF="/home/ubuntu/resources/ensembl/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
HISATREF="/mnt/hisat_indexes/Homo_sapiens.GRCh38.dna.toplevel"
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

# 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"
SAMTOOLS=" /home/ubuntu/install/samtools_rocksdb/samtools/samtools "


#set the filename of the file with the list of accessions   
if config["ACCESSION_FILE"]:
  filename = config["ACCESSION_FILE"]
else:
  filename = "ACCESSIONS"

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

if config["WORKING_DIR"]:
  WORKING_DIR=config["WORKING_DIR"]
else: 
  WORKING_DIR=os.getcwd()



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)


rule clean: 
  shell: "rm -fr log qc bams counts  "



rule project_counts:
  output: "project.featureCounts"
  input: GTFFILE, expand("bams/{sample}.GRCh38.ens77.hisat.sorted.bam", sample=SAMPLES)
  log: "log/project.featureCounting.log"
  threads: THREADS 
{'fraction_non_alphanumeric': 0.13949759486905397, 'fraction_numerical': 0.026189203634420097, 'mean_word_length': 5.354838709677419, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7176334', 'n_tokens_mistral': 1589, 'n_tokens_neox': 1472, 'n_words': 246}