diff --git a/SUBMIT_CONFIG/slurm/cluster.yaml b/SUBMIT_CONFIG/slurm/cluster.yaml index fb3e45ed39a1d486b6ac0682de054e5293db3d41..d50e4dfc51ff26a0421d4416492282c494e54aee 100644 --- a/SUBMIT_CONFIG/slurm/cluster.yaml +++ b/SUBMIT_CONFIG/slurm/cluster.yaml @@ -1,39 +1,38 @@ __default__: jobname: 'GEP.{rule}' - partition: begendiv + partition: begendiv,main nCPUs: "{threads}" qos: 'standard' - nodes: 1 unzipFasta_PRI: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:00" symlinkUnzippedFasta_PRI: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:00" unzipFasta_ALT: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:00" symlinkUnzippedFasta_ALT: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:05" busco5: jobname: GEP.{rule}.{wildcards.asmID} - memory: 100000 + memory: 150000 time: "1-00:00:00" @@ -41,14 +40,14 @@ busco5: moveBuscoOutputs: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:05" merqury: jobname: GEP.{rule}.{wildcards.asmID} - memory: 20000 + memory: 40000 time: "08:00:00" @@ -56,50 +55,184 @@ merqury: genomescope2: jobname: GEP.{rule}.{wildcards.asmID}.{wildcards.kmer} memory: 500 - time: "00:00:05" + time: "00:05:00" assemblyStats: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:00" saveConfiguration_and_getKeyValues_kmer: jobname: GEP.{rule}.{wildcards.asmID}.{wildcards.kmer} memory: 500 - time: "00:00:05" + time: "00:05:00" saveConfiguration_and_getKeyValues: jobname: GEP.{rule}.{wildcards.asmID} memory: 500 - time: "00:00:05" + time: "00:05:05" aggregateAllAssemblies: jobname: GEP.{rule} memory: 500 - time: "00:00:05" + time: "00:05:05" makeReport: jobname: GEP.{rule}.{wildcards.asmID}.{wildcards.kmer} memory: 500 - time: "00:00:05" + time: "00:05:05" addFullTable: jobname: GEP.{rule} memory: 500 - time: "00:00:05" + time: "00:05:05" aggregateReport: jobname: GEP.{rule} memory: 500 - time: "00:00:05" + time: "00:05:05" makePDF: jobname: GEP.{rule} memory: 500 - time: "00:00:05" + time: "00:05:05" + +###### Rules for illuminadb building ########## + +unzipFasta_R1: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trim10x}.{wildcards.trimAdapters} + memory: 96000 + time: "00:30:05" + + +unzipFasta_R2: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trim10x}.{wildcards.trimAdapters} + memory: 96000 + time: "00:30:05" + +symlinkUnzippedFasta_R1: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trim10x}.{wildcards.trimAdapters} + memory: 500 + time: "00:00:35" + +symlinkUnzippedFasta_R2: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trim10x}.{wildcards.trimAdapters} + memory: 500 + time: "00:00:35" + + + + +symLink_trim10xbarcodes_notrimAdapt: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter} + memory: 500 + time: "00:00:35" + +symlinks_no10xOrAdaptTrim: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter} + memory: 500 + time: "00:00:35" + + +symlinks_no10xwithAdaptTrim: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter} + memory: 500 + time: "00:00:35" + + +symlink_trim10xbarcodesR2: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trimAdapters} + memory: 500 + time: "00:00:35" + + +trim10xbarcodes: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trimAdapters} + memory: 500 + time: "01:00:05" + + + +trimAdapters: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trim10x} + memory: 500 + time: "02:00:05" + + +fastqc_Illumina: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trimAdapters}.{wildcards.trim10x} + memory: 500 + time: "00:30:05" + +multiqc_hifi: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.trimAdapters}.{wildcards.trim10x} + memory: 500 + time: "00:05:05" + +meryl_R1: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trimAdapters}.{wildcards.trim10x}.{wildcards.kmer} + memory: 20000 + time: "01:00:05" + +meryl_R2: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.trimAdapters}.{wildcards.trim10x}.{wildcards.kmer} + memory: 20000 + time: "01:00:05" + +meryl_illumina_build: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.trimAdapters}.{wildcards.trim10x}.{wildcards.kmer} + memory: 30000 + time: "00:45:05" + + + + +###### HIFI BUILD ####### + +unzipHifi: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.smrtornot} + memory: 128000 + time: "00:30:05" + +symlinkUnzippedHifi: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.smrtornot} + memory: 500 + time: "00:05:05" + +symlinkfornotSmartTrimmed: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter} + memory: 500 + time: "00:05:05" + + +fastqc_hifi_SMRT_removed: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.smrtornot} + memory: 12000 + time: "00:45:05" + +multiqc_hifi_SMRTremoved: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.smrtornot} + memory: 4000 + time: "00:15:05" + +meryl_hifi_trimmed_count: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter}.{wildcards.smrtornot}.{wildcards.kmer} + memory: 96000 + time: "02:30:05" + +meryl_hifi_build: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.smrtornot}.{wildcards.kmer} + memory: 96000 + time: "01:30:05" + + +trimSMRTbell: + jobname: GEP.{rule}.{wildcards.sample}.{wildcards.readCounter} + memory: 96000 + time: "01:30:05" diff --git a/SUBMIT_CONFIG/slurm/config.yaml b/SUBMIT_CONFIG/slurm/config.yaml index 07b01f5a0b325352add3c85055df969ada221add..35f16593b733056d061b82d35b185132ef6dfdd6 100644 --- a/SUBMIT_CONFIG/slurm/config.yaml +++ b/SUBMIT_CONFIG/slurm/config.yaml @@ -9,9 +9,8 @@ cluster: --cpus-per-task={cluster.nCPUs} --mem={cluster.memory} --job-name={cluster.jobname} - --output=slurm_logs/{rule}/{rule}-{wildcards}-%j.out + --output=slurm_logs/{rule}/{rule}.{wildcards}.%j.out --time={cluster.time} - --nodes={cluster.nodes} #User Defines below parameters diff --git a/rules/hifi_05_11_21.smk b/rules/hifi_05_11_21.smk index 2648a562c8590bc90ae552c5a2ef17a1bb2d3670..64b27dc00b21a08dce228f9011a37fe172ad6dad 100644 --- a/rules/hifi_05_11_21.smk +++ b/rules/hifi_05_11_21.smk @@ -38,9 +38,11 @@ rule unzipHifi: os.path.join(config['Results'], "0_buildDatabases/{sample}/logs/hifiReads/{readCounter}.{smrtornot}_pigzUnzip.log") conda: "../envs/pigz.yaml" + threads: + 4 shell: """ - pigz -c -d -k {input.fastq} > {output} 2> {log} + pigz -p {threads} -c -d -k {input.fastq} > {output} 2> {log} """ rule symlinkUnzippedHifi: @@ -50,6 +52,8 @@ rule symlinkUnzippedHifi: os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/01_unzipFastqs/{readCounter}.{smrtornot}.fastq"), log: os.path.join(config['Results'], "0_buildDatabases/{sample}/logs/hifiReads/{readCounter}.{smrtornot}_pigzUnzip.log") + threads: + 1 shell: """ ln -s {input.fastq} {output} @@ -99,6 +103,8 @@ rule symlinkfornotSmartTrimmed: os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/01_unzipFastqs/{readCounter}.notsmrtTrimmed.fastq"), output: outputFile=os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/02_trimReads/{readCounter}.notsmrtTrimmed.fastq") + threads: + 1 shell: """ ln -s {input} {output.outputFile} @@ -111,7 +117,8 @@ rule fastqc_hifi_SMRT_removed: folder2out=os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/05_multiqc/") output: os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/05_multiqc/{readCounter}.{smrtornot}_fastqc.html") - threads: 1 + threads: + 1 log: os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/logs/{readCounter}.{smrtornot}.FastQC.log") conda: @@ -130,6 +137,8 @@ rule multiqc_hifi_SMRTremoved: filename="{sample}.{smrtornot}.multiqcReport.html" output: os.path.join(config['Results'],"0_buildDatabases/{sample}/hifiReads/05_multiqc/{sample}.{smrtornot}.multiqcReport.html") + threads: + 1 log: os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/logs/{sample}.{smrtornot}.multiqc.log") conda: @@ -149,7 +158,7 @@ rule meryl_hifi_trimmed_count: kmer = "{kmer}" # path= os.path.join(config['Results'], "{sample}" +"/2_QVstats_merylAndMerqury/") threads: - workflow.cores * 0.25 + 16 output: directory(os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/03_merylDb/" + "{readCounter}" + "_hifi_dB.{smrtornot}.{kmer}.meryl")), log: @@ -172,7 +181,7 @@ rule meryl_hifi_build: params: kmer = "{kmer}" threads: - workflow.cores * 0.5 + 16 output: directory(os.path.join(config['Results'], "0_buildDatabases/{sample}/hifiReads/03_merylDb/complete_hifi_{sample}_dB.{smrtornot}.{kmer}.meryl")), log: diff --git a/rules/illumina_05_11_21.smk b/rules/illumina_05_11_21.smk index b8729f913e9f11f4a6eedef4766532d832495813..83fb00ba7be6c583d05705d78a58334e168808aa 100644 --- a/rules/illumina_05_11_21.smk +++ b/rules/illumina_05_11_21.smk @@ -45,9 +45,11 @@ rule unzipFasta_R1: os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/logs/{readCounter}.{trim10x}.{trimAdapters}_R1_pigzUnzip.log") conda: "../envs/pigz.yaml" + threads: + 4 shell: """ - pigz -c -d -k {input.assembly} > {output} 2> {log} + pigz -p {threads} -c -d -k {input.assembly} > {output} 2> {log} """ rule symlinkUnzippedFasta_R1: @@ -55,6 +57,8 @@ rule symlinkUnzippedFasta_R1: assembly=R1_notgzipped, output: temp(os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/01_unzipFastqs/{readCounter}.{trim10x}.{trimAdapters}_R1.fastq")), + threads: + 1 shell: """ ln -s {input} {output} @@ -69,9 +73,11 @@ rule unzipFasta_R2: os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/logs/{readCounter}.{trim10x}.{trimAdapters}_R2_pigzUnzip.log") conda: "../envs/pigz.yaml" + threads: + 4 shell: """ - pigz -c -d -k {input.assembly} > {output} 2> {log} + pigz -p {threads} -c -d -k {input.assembly} > {output} 2> {log} """ rule symlinkUnzippedFasta_R2: @@ -79,6 +85,8 @@ rule symlinkUnzippedFasta_R2: assembly=R2_notgzipped, output: temp(os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/01_unzipFastqs/{readCounter}.{trim10x}.{trimAdapters}_R2.fastq")), + threads: + 1 shell: """ ln -s {input} {output} @@ -93,7 +101,7 @@ rule trim10xbarcodes: read1=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.10xTrimmed.{trimAdapters}_Read1.fastq")), # read2=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.10xTrimmed.{trimAdapters}_Read2.fastq")) threads: - workflow.cores * 0.125 + 4 log: os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/logs/{readCounter}.10xTrimmed.10BarcodeRemoval_Trimmomatic.{trimAdapters}.log") conda: @@ -105,7 +113,7 @@ rule trim10xbarcodes: # ln -s {input.read2} {output.read2} -rule trim10xbarcodesR2: +rule symlink_trim10xbarcodesR2: input: read2=os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/01_unzipFastqs/{readCounter}.10xTrimmed.{trimAdapters}_R2.fastq") output: @@ -128,6 +136,8 @@ rule symLink_trim10xbarcodes_notrimAdapt: output: read1=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.10xTrimmed.notAdaptTrimmed_val_1.fq")), read2=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.10xTrimmed.notAdaptTrimmed_val_2.fq")) + threads: + 1 shell: """ ln -s {input.read1} {output.read1} @@ -141,6 +151,8 @@ rule symlinks_no10xOrAdaptTrim: output: read1=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.not10xTrimmed.notAdaptTrimmed_val_1.fq")), read2=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.not10xTrimmed.notAdaptTrimmed_val_2.fq")) + threads: + 1 shell: """ ln -s {input.read1} {output.read1} @@ -154,6 +166,8 @@ rule symlinks_no10xwithAdaptTrim: output: read1=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.not10xTrimmed.AdaptTrimmed_Read1.fastq")), read2=temp(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/02_trimReads/{readCounter}.not10xTrimmed.AdaptTrimmed_Read2.fastq")) + threads: + 1 shell: """ ln -s {input.read1} {output.read1} @@ -193,13 +207,14 @@ rule fastqc_Illumina: os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/04_fastqc/{readCounter}.{trim10x}.{trimAdapters}_val_2_fastqc.html") log: os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/logs/{readCounter}.{trim10x}.{trimAdapters}_fastqc.log") - threads: 1 + threads: + 4 conda: "../envs/pigz.yaml" shell: "(fastqc {input} -o {params.folder2out} -t {threads}) &> {log}" -rule multiqc_hifi_SMRTremoved: +rule multiqc_hifi: input: read1=lambda wildcards: expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/04_fastqc/{readCounter}.{trim10x}.{trimAdapters}_val_1_fastqc.html"), sample=wildcards.sample, readCounter=d[wildcards.sample], trim10x=testDict[wildcards.sample][1], trimAdapters=testDict[wildcards.sample][2]), read2=lambda wildcards: expand(os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/04_fastqc/{readCounter}.{trim10x}.{trimAdapters}_val_2_fastqc.html"), sample=wildcards.sample, readCounter=d[wildcards.sample], trim10x=testDict[wildcards.sample][1], trimAdapters=testDict[wildcards.sample][2]) @@ -211,6 +226,8 @@ rule multiqc_hifi_SMRTremoved: os.path.join(config['Results'],"0_buildDatabases/{sample}/illuminaReads/05_multiqc/{sample}.{trim10x}.{trimAdapters}.multiqcReport.html") log: os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/logs/{sample}.{trim10x}.{trimAdapters}_multiqc.log") + threads: + 1 conda: "../envs/pigz.yaml" shell: @@ -225,7 +242,7 @@ rule meryl_R1: kmer = "{kmer}", # path= os.path.join(config['Results'], "{sample}" +"/2_QVstats_merylAndMerqury/") threads: - workflow.cores * 0.25 + 16 output: temp(directory(os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/03_merylDb/{readCounter}.{trim10x}.{trimAdapters}_R1.{kmer}.meryl"))) log: @@ -247,7 +264,7 @@ rule meryl_R2: kmer = "{kmer}", # path= os.path.join(config['Results'], "{sample}" +"/2_QVstats_merylAndMerqury/") threads: - workflow.cores * 0.25 + 16 output: temp(directory(os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/03_merylDb/{readCounter}.{trim10x}.{trimAdapters}_R2.{kmer}.meryl"))) log: @@ -263,7 +280,7 @@ rule meryl_R2: """ -rule meryl_hifi_build: +rule meryl_illumina_build: input: # reads= rules.trimSMRTbell.output.outputFile{readCounter}.{trim10x}.{trimAdapters} # lambda wildcards: expand(config['Results'],"{group}/alignment/{sample}.bam", group=wildcards.group, sample=GROUPS[wildcards.group] @@ -274,7 +291,7 @@ rule meryl_hifi_build: kmer = "{kmer}", path= os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/03_merylDb/") threads: - workflow.cores * 0.5 + 16 output: directory(os.path.join(config['Results'], "0_buildDatabases/{sample}/illuminaReads/03_merylDb/{sample}_illuminaDb.{trim10x}.{trimAdapters}.{kmer}.meryl")), log: diff --git a/rules/run_05_11_21.smk b/rules/run_05_11_21.smk index a0728058afa3fdce087e5acffc8cfd76d8e23fe8..52b80adec54dd6eea7fcbdf05dc1ad4308ae8020 100644 --- a/rules/run_05_11_21.smk +++ b/rules/run_05_11_21.smk @@ -111,7 +111,7 @@ rule busco5: shell: """ cd {params.chngDir} - (busco -m {params.mode} --in {input.assembly} -o {params.assemblyName} -l {input.lineage} -c {threads} -f --limit 5) &> {log} + (busco -m --offline {params.mode} --in {input.assembly} -o {params.assemblyName} -l {input.lineage} -c {threads} -f --limit 5) &> {log} """ # ln -s {input.assembly} {output.symlink} @@ -395,7 +395,7 @@ rule saveConfiguration_and_getKeyValues: echo "$(grep 'total_bps' {input.scaffStats} | awk {{'print $3'}})" >> {params.keyValues} echo "$(grep 'Genome Haploid Length' {input.gscopeSum} | awk {{'print $6'}} )" >> {params.keyValues} echo "$(grep 'Heterozygous (ab)' {input.gscopeSum} | awk {{'print $4'}})" >> {params.keyValues} - echo "$(grep 'gc_content' {input.scaffStats} | awk {{'print $2'}})" >> {params.keyValues} + echo "$(grep 'gc_content' {input.scaffStats} | awk {{'print $3'}})" >> {params.keyValues} echo "$(grep 'sequence_count' {input.scaffStats} | awk {{'print $2'}})" >> {params.keyValues} echo "$(grep 'sequence_count' {input.contStats} | awk {{'print $2'}})" >> {params.keyValues} echo "$(grep 'number_of_gaps' {input.contStats} | awk {{'print $2'}})" >> {params.keyValues} diff --git a/scripts/stats.py b/scripts/stats.py index 38b1fc441a29171a8a83449cdd8eefea741d2a79..a374b702b34e0b3a08b515ede0344ba32663b7cc 100644 --- a/scripts/stats.py +++ b/scripts/stats.py @@ -91,6 +91,7 @@ def read_genome(fasta_file): total_len += len(contig) contig_lens.append(len(contig)) gc_cont = (gc / total_len) * 100 +# print("this is gc_content", gc_cont) return contig_lens, scaffold_lens, gc_cont @@ -182,10 +183,13 @@ if __name__ == "__main__": contig_lens, scaffold_lens, gc_cont = read_genome(infilename) # contig_stats = calculate_stats(contig_lens, gc_cont) scaffold_stats = calculate_stats(scaffold_lens, gc_cont) + rounded_gc = round(gc_cont, 4) +# print("this is the rounded_gc: ", rounded_gc) contig_stats = calculate_stats(contig_lens, gc_cont) gaps=contig_stats.get('sequence_count') - scaffold_stats.get('sequence_count') scaffold_stats['number_of_gaps'] = gaps contig_stats['number_of_gaps'] = gaps +# print("this is the scaffold_stats: ", scaffold_stats) # print(scaffold_stats) # df_scaffold_all= pd.DataFrame.from_dict(scaffold_stats, orient= 'index') # print(df_scaffold_all) @@ -196,8 +200,14 @@ if __name__ == "__main__": # s.reset_index() # print(s) scaff_seq=pd.DataFrame(scaffold_stats.items(), columns=['Assembly:', naming]) +# print("this is the scaff_seq: ", scaff_seq) df_scaffold_top=scaff_seq.iloc[0:7,0:2] +# print("this is GC CONTENT", gc_cont) df_scaffold_top[naming]=df_scaffold_top[naming].astype('int64').apply('{:,}'.format) +# print("this is the top: ", df_scaffold_top) + df_scaffold_top[naming][2] = rounded_gc +# print("this is df_scaffold_top[naming][2]", df_scaffold_top[naming][2]) +# print("this is the top: ", df_scaffold_top) # df_scaffold_top=df_scaffold_top.style.hide_index() # df_scaffold_top[naming].round(decimals=0) # df_contig_all=pd.DataFrame(data=contig_stats) @@ -232,6 +242,7 @@ if __name__ == "__main__": contig_seq=pd.DataFrame(contig_stats.items(), columns=['Assembly:', naming]) df_contig_top=contig_seq.iloc[0:7,0:2] df_contig_top[naming]=df_contig_top[naming].astype('int64').apply('{:,}'.format) + df_contig_top[naming][2] = rounded_gc # df_scaffold_top=df_scaffold_top.style.hide_index() # df_scaffold_top[naming].round(decimals=0) # df_contig_all=pd.DataFrame(data=contig_stats) @@ -326,21 +337,21 @@ if __name__ == "__main__": # print(tabulate(df_contig_L_LG, headers='keys',tablefmt="rst", showindex=False), file=outputRst2) # print("", file=outputRst2) - with open(sys.argv[4], 'w') as outputRst: - print(tabulate(df_scaffold_top, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) - print("", file=outputRst) - print(tabulate(df_scaffold_N_NG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) - print("", file=outputRst) - print(tabulate(df_scaffold_L_LG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) - print("", file=outputRst) - # - with open(sys.argv[5], 'w') as outputRst2: - print(tabulate(df_contig_top, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) - print("", file=outputRst2) - print(tabulate(df_contig_N_NG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) - print("", file=outputRst2) - print(tabulate(df_contig_L_LG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) - print("", file=outputRst2) + # with open(sys.argv[4], 'w') as outputRst: + # print(tabulate(df_scaffold_top, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) + # print("", file=outputRst) + # print(tabulate(df_scaffold_N_NG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) + # print("", file=outputRst) + # print(tabulate(df_scaffold_L_LG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst) + # print("", file=outputRst) + # # + # with open(sys.argv[5], 'w') as outputRst2: + # print(tabulate(df_contig_top, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) + # print("", file=outputRst2) + # print(tabulate(df_contig_N_NG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) + # print("", file=outputRst2) + # print(tabulate(df_contig_L_LG, headers='keys',tablefmt="pipe", showindex=False), file=outputRst2) + # print("", file=outputRst2) # list_of_dfs=[df_scaffold_top,df_scaffold_N_NG,df_scaffold_L_LG] # for df in list_of_dfs: # with open('all_dfs.tsv','a') as f: