From 19b11597e95b2d89eba86091a605aa64ad7061c5 Mon Sep 17 00:00:00 2001 From: katiesevans Date: Thu, 10 Feb 2022 10:06:17 -0600 Subject: [PATCH] file name changes --- bin/process_ibd_nf_final.R | 7 ++++--- bin/reoptimzied_divergent_region_characterization.Rmd | 9 +++++++-- main.nf | 7 ++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/bin/process_ibd_nf_final.R b/bin/process_ibd_nf_final.R index 372aa14..416f250 100644 --- a/bin/process_ibd_nf_final.R +++ b/bin/process_ibd_nf_final.R @@ -303,8 +303,9 @@ ggplot(plot_df, facet_grid(.~chromosome, scales="free", space="free") + theme(legend.position="none") -ggsave("haplotype.pdf", height = 48, width = 24) -ggsave("haplotype3.pdf", height = 70, width = 35, limitsize = FALSE) +# might need to make longer with more strains... +ggsave("haplotype.pdf", height = 70, width = 35, limitsize = FALSE) +ggsave("haplotype.png", height = 70, width = 35, limitsize = FALSE) @@ -332,7 +333,7 @@ ggplot(plot_df, facet_grid(.~chromosome, scales="free", space="free") + theme(legend.position="none") -ggsave(paste("max_haplotype_genome_wide.pdf"), +ggsave(paste("sweep.pdf"), height = 70, width = 35, limitsize = FALSE) #===============# diff --git a/bin/reoptimzied_divergent_region_characterization.Rmd b/bin/reoptimzied_divergent_region_characterization.Rmd index 6bbbc6a..b2b2df1 100644 --- a/bin/reoptimzied_divergent_region_characterization.Rmd +++ b/bin/reoptimzied_divergent_region_characterization.Rmd @@ -288,9 +288,13 @@ write.csv(df_divergent_final_isotype, file="DataS3_divergent_regions_isotypes.cs div_bed <- df_divergent_final_isotype %>% dplyr::select(CHROM, cluster_start, cluster_end, STRAIN) %>% - dplyr::arrange(CHROM, cluster_start) + dplyr::arrange(CHROM, cluster_start) %>% + dplyr::mutate(cluster_start = as.numeric(cluster_start), + cluster_end = as.numeric(cluster_end)) -write.table(div_bed, "divergent_regions_strain.bed", quote=F, col.names = F, row.names=F, sep="\t") +# write.table(div_bed, "divergent_regions_strain.bed", quote=F, col.names = F, row.names=F, sep="\t") +# see if this avoids the errors with 1.4e+07... +readr::write_tsv(div_bed, "divergent_regions_strain.bed", col_names = F) ## total size @@ -374,6 +378,7 @@ df_div_all <- df_divergent_final %>% dplyr::arrange(., chr, start) readr::write_tsv(df_div_all, "All_divergent_regions.tsv") +readr::write_tsv(df_div_all, "divergent_regions_all.bed") ## clustered diff --git a/main.nf b/main.nf index 44a8982..bbf0f66 100644 --- a/main.nf +++ b/main.nf @@ -550,7 +550,7 @@ process define_divergent_region { file("*") output: - tuple file("divergent_regions_strain.bed"), file("divergent_regions.png") + tuple file("divergent_regions_strain.bed.gz"), file("divergent_regions_all.bed.gz"), file("divergent_regions.png") """ cp ${workflow.projectDir}/bin/reoptimzied_divergent_region_characterization.Rmd reoptimzied_divergent_region_characterization.Rmd @@ -562,6 +562,11 @@ process define_divergent_region { cp ${params.bin_bed} ./divergent_bins.bed cp divergent_regions_strain.bed ./divergent_df_isotype.bed + # gzip divergent files + gzip divergent_regions_strain.bed + cp All_divergent_regions.tsv divergent_regions_all.bed + gzip divergent_regions_all.bed + """ }