Skip to content

06_PROFILES

eolesin edited this page Mar 23, 2021 · 12 revisions

Step 1. Activate the Anvio environment

Step 2. Had to migrate the contig databases.

If you have started your analysis with Anvio7 you will not need to do this step. Since our analysis began with Anvio6-2 and we had to update to Anvio7 to continue with the pipeline, we must perform this step.

# cd into the 04_CONTIGS/ directory
# migrate the databases
anvi-migrate *.db --migrate-dbs-quickly

Step 3. Profiling of samples

Perform a nested loop as was done for the mapping step. Do not try to parallelize this! Anvio-profile gets confused if you try to start multiple processes for this at once.

conda activate anvio_emily

while read line;      
    do         
    SET=$(echo $line | cut -d" " -f1);          
    samples=$(echo $line | cut -d" " -f2);          
    delimiter=",";          
    declare -a Smparray=($(echo $samples | tr "$delimiter" " "));         
    for samp in "${Smparray[@]}"; 
        do
            anvi-profile -c 04_CONTIGS/$SET-CONTIGS.db \
            -i 05_MAPPING/$samp.bam \
            --skip-SNV-profiling \
            --num-threads 40 \
            -o 06_PROFILES/$samp
        done;     
    done < samples_in_sets.txt

Step 3. Merge profiles for each co-assembly

while read line;           
    do              
    SET=$(echo $line | cut -d" " -f1);               
    samples=$(echo $line | cut -d" " -f2);               
    delimiter=",";               
    declare -a Smparray=($(echo $samples | tr "$delimiter" " ")); 
    prefix="05_MAPPING/"; suffix="/PROFILE.db"; 
    declare -a newarray=();              
    for samp in "${Smparray[@]}";          
        do newarray+=($(echo ${prefix}${samp}${suffix}));         
        done; 
    anvi-merge -c 04_CONTIGS/$SET-CONTIGS.db  ${newarray[@]} \
    -o MERGED_PROFILES/$SET-MERGED-PROFILE;         
    done < samples_in_sets.txt



Clone this wiki locally