# HG changeset patch # User greg # Date 1610464798 0 # Node ID bcb28b49b0cc4970c550f99e3f6c659ad774c91f # Parent 0488ca4a8c4e8fc65276ee6caf1582dcd58afb16 Uploaded diff -r 0488ca4a8c4e -r bcb28b49b0cc coral_multilocus_genotype.R --- a/coral_multilocus_genotype.R Wed Nov 11 18:09:01 2020 +0000 +++ b/coral_multilocus_genotype.R Tue Jan 12 15:19:58 2021 +0000 @@ -114,6 +114,8 @@ genind_clone cat("\n\n"); time_elapsed(start_time); +# Remove genind object from memory. +rm(genind_obj); # Calculate the bitwise distance between individuals. start_time <- time_start("Calculating the bitwise distance between individuals"); @@ -409,6 +411,8 @@ # Rename the id_rep column. setnames(id_data_table, c("id_rep"), c("affy_id")); time_elapsed(start_time); +# Remove clonecorrect genind from memory. +rm(no_dup_genotypes_genind); # Table of alleles for the new samples subset to new plate data. # Create vector indicating number of individuals desired from @@ -421,6 +425,12 @@ affy_list <- append(stag_db_report$affy_id,"FORMAT"); svcf <- vcf[,colnames(vcf@gt) %in% affy_list]; write.vcf(svcf, "subset.vcf.gz"); + +# Remove original and subset VCFs written to file from R memory. +rm(svcf); +rm(vcf); + +# Load in subset VCF. vcf.fn <- "subset.vcf.gz"; snpgdsVCF2GDS(vcf.fn, "test3.gds", method="biallelic.only"); genofile <- snpgdsOpen(filename="test3.gds", readonly=FALSE); @@ -895,4 +905,3 @@ colnames(taxonomy_table_data_frame) <- c("genetic_coral_species_call", "affy_id", "genus_name", "species_name"); write_data_frame(output_data_dir, "taxonomy.tabular", taxonomy_table_data_frame); time_elapsed(start_time); -