changeset 7:bcb28b49b0cc draft

Uploaded
author greg
date Tue, 12 Jan 2021 15:19:58 +0000
parents 0488ca4a8c4e
children 33d759858625
files coral_multilocus_genotype.R
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
-