This script was designed to create a data set with each individual Sample in Freezerworks that will tell you the total number and/or volume of aliquots based on the sample type. It can also summarize by Participant ID, report the total number of collections per participant, sort/filter by different criteria, and report the number of distinct participants that match your criteria.
Primary Output:
Sample Summary Table: Lists each individual sample. Columns summarize the number of aliquots of each sample type
Participant Summary Table: Lists each participant. Columns summarize the number of aliquots of each sample type
For more detail on a SINGLE Sample Type:
Sample Summary with Status: Lists each individual sample. Columns summarize the total number of aliquots with a breakdown by aliquot status
Parent ID Summary with Status: Lists each parent aliquot. Columns summarize the total number of aliquots with a breakdown by aliquot status
Participant Summary with Status: Lists each participant. Columns summarize the total number of aliquots with a breakdown by aliquot status
You'll need to export two files from Freezerworks, one for Samples and one for
Aliquots. The script works for .txt files (default format for FW exports). When you
run the script in R, make sure the exported files are in the working directory.
Once you copy and paste the script into R, DO NOT try to run parts of the script
multiple times (for example if you edit a section). It will mess up the output. To run a
part again, “Restart and Run all chunks”.
Please fill out ALL of the options below before launching. You can change your selections and relaunch if needed.
Sample file: First pull up all samples in list view, click on "Reports" from the top bar, and select
"Samples Backup". Remove the "Sample Notes" and "Aliquots Notes" fields from the column on the
right and export the file.
Enter the name of the exported file, including .txt. You do not need quotes.
Aliquots file: Go back to the list view, and click on the Aliquots tab to view all Aliquots. Now do the
same thing, but select "Basic Aliquots Export". You do not need to alter any fields, simply export the
file. This will take several minutes.
Enter the name of the exported file, including .txt. You do not need quotes.
Do you want “Pulled” Aliquots to be removed from the summary?
Yes
No
Do you want “Depleted” Aliquots to be removed from the summary?
Yes
No
Do you want Aliquots that have been “Provided to Collaborator” to be removed
from the summary?
Yes
No
Do you want the summary to be of one study, or all studies?
If you want to limit it to one study, enter the Study Abbreviation:
Enter any filters using this example format. You can include as many or as few as you want. Use logical operators (&, | , == , !=, >, < , >= , <=) if needed.
Example input: TEW_Participant_ID=="P04" & TEW_Visit=="Day 13"
Yes
No
These are the output columns. If you’re only interested in a few, list them here.
No quotes needed, just the column names separated by commas.
Note: Any number in a column name is the volume (mL). For serum and plasma samples, columns with numbers
report the number of aliquots in a sample that are greater than or equal to the specific volume. Because serum is
often saved in 100uL aliquots, No.Serum_0.1 counts the number of aliquots exactly equal to 100uL. For Stool and
BCP samples, the number just refers to the container size of the aliquot.
The last three columns are essentially a True/False of whether or not Blood, Urine, or Stool was collected from
that sample, therefore the values will always be either “1” or “NA”.
Some Columns
All Columns
Do you want any of the output columns to meet specific criteria? If so, list the
criteria here.
Example: I only want samples where urine and at least 3 mL of serum were
collected. You would enter
No.Whole_Urine>=1 & Total_Volume_Serum>=3
Yes
No
Do you want the R to report the number of unique Participant IDs that meet the
above criteria?
Yes
No
Do you want to sort/order the summary for the individual samples?
Enter the names of the columns you want to sort (in order). Include “Samples$”
ahead of the column name
Example: Samples$TEW_Participant_ID, Samples$TEW_Visit
Yes
No
Do you want to sort/order the summary for the different participants?
Enter the names of the columns you want to sort (in order). Include “SampleSum$” ahead of the column name.
Column names include: TEW_Participant_ID
TEW_Study_Abbrev
Number.of.Aliquots.Total
Number.of.Aliquots.with.Positions
All of the columns selected from the “Samples” output above
n
(Column “n” is the total number of samples from the participant that meet your criteria)
Example: SampleSum$TEW_Study_Abbrev, SampleSum$n
Yes
No
Do you want to the summary for each sample to be exported as a txt file?
If yes, put what you want the file to be named.
Yes
No
Do you want to the summary for each participant to be exported as a txt file?
If yes, put what you want the file to be named.
Yes
No
Sample Summary with Status: Do you want to the summary for each participant to be exported as a txt file?
If yes, put what you want the file to be named.
For which sample type?
Yes
No
Do you want to sort/order this output table?
Enter the names of the columns you want to sort (in order). Include “Sample_Type_With_Status$” ahead of the column name. Column names are listed below
"TEW_Study_Abbrev"
"TEW_Participant_ID"
"Freezerworks.ID"
"X0_Visit_Date"
"TEW_Visit"
"TEW_Collection_Date"
"TEW_SampleType"
"No.Total"
"No.Distributed"
"No.Pulled"
"No.Depleted"
"No.Provided.to.Collab"
Parent ID Summary with Status: For more detail on a single sample type, do you want a Parent ID Summary summary with a breakdown by aliquot status?
For which sample type?
Yes
No
Do you want to sort/order this output table?
Enter the names of the columns you want to sort (in order). Include “Sample_Type_Summary_by_Parent_Aliquot$” ahead of the column name. Column names are listed below
"TEW_Study_Abbrev"
"TEW_Participant_ID"
"Freezerworks.ID"
"X0_Visit_Date"
"TEW_Visit"
"TEW_Collection_Date"
"TEW_SampleType"
"No.Total"
"No.Distributed"
"No.Pulled"
"No.Depleted"
"No.Provided.to.Collab"
"Parent.Aliquot.ID"
Participant Summary with Status: For more detail on a single sample type, do you want a Participant ID summary with a breakdown by aliquot status?
For which sample type?
Yes
No
Do you want to sort/order this output table?
Enter the names of the columns you want to sort (in order). Include “Sample_Type_Summary_by_Participant$” ahead of the column name. Column names are listed below
"TEW_Study_Abbrev"
"TEW_Participant_ID"
"Freezerworks.ID"
"X0_Visit_Date"
"TEW_Visit"
"TEW_Collection_Date"
"TEW_SampleType"
"No.Total"
"No.Distributed"
"No.Pulled"
"No.Depleted"
"No.Provided.to.Collab"