
> library(shipunov)
package 'shipunov', version 1.2-1

> setwd("20_sets")

> system(paste0("mafft ", "its.fasta", " > ", "../30_alignments/", "its_mafft.fasta"))

nseq =  48
distance =  ktuples
iterate =  0
cycle =  2
sparsepickup = 0
nguidetree = 2
nthread = 0
sueff_global = 0.100000
generating a scoring matrix for nucleotide (dist=200) ... done
done
done
scoremtx = -1
charsize=128
Gap Penalty = -1.53, +0.00, +0.00

tuplesize = 6, dorp = d


Making a distance matrix ..

There are 24 ambiguous characters.

    1 / 48
done.

Constructing a UPGMA tree ... 

    0 / 48
   10 / 48
   20 / 48
   30 / 48
   40 / 48
done.

Progressive alignment 1/2... 

STEP     1 / 47 f
STEP     2 / 47 f
STEP     3 / 47 f
STEP     4 / 47 d
STEP     5 / 47 d
STEP     6 / 47 d
Reallocating..done. *alloclen = 1816

STEP     7 / 47 d
STEP     8 / 47 f
STEP     9 / 47 d
STEP    10 / 47 f
STEP    11 / 47 f
STEP    12 / 47 d
STEP    13 / 47 d
STEP    14 / 47 f
STEP    15 / 47 d
STEP    16 / 47 d
STEP    17 / 47 f
STEP    18 / 47 f
STEP    19 / 47 d
STEP    20 / 47 f
STEP    21 / 47 d
STEP    22 / 47 f
STEP    23 / 47 f
STEP    24 / 47 d
STEP    25 / 47 d
STEP    26 / 47 d
STEP    27 / 47 d
STEP    28 / 47 d
STEP    29 / 47 d
STEP    30 / 47 d
STEP    31 / 47 d
STEP    32 / 47 d
STEP    33 / 47 d
STEP    34 / 47 d
STEP    35 / 47 f
STEP    36 / 47 d
STEP    37 / 47 d
STEP    38 / 47 d
STEP    39 / 47 f
STEP    40 / 47 f
STEP    41 / 47 d
STEP    42 / 47 f
STEP    43 / 47 f
STEP    44 / 47 d
STEP    45 / 47 d
STEP    46 / 47 d
STEP    47 / 47 d
done.

Making a distance matrix from msa.. 

    0 / 48
   10 / 48
   20 / 48
   30 / 48
   40 / 48
done.

Constructing a UPGMA tree ... 

    0 / 48
   10 / 48
   20 / 48
   30 / 48
   40 / 48
done.

Progressive alignment 2/2... 

STEP     1 / 47 f
STEP     2 / 47 f
STEP     3 / 47 f
STEP     4 / 47 f
STEP     5 / 47 f
STEP     6 / 47 f
STEP     7 / 47 f
STEP     8 / 47 f
STEP     9 / 47 d
STEP    10 / 47 f
STEP    11 / 47 d
STEP    12 / 47 f
STEP    13 / 47 f
STEP    14 / 47 d
STEP    15 / 47 f
STEP    16 / 47 f
STEP    17 / 47 d
STEP    18 / 47 f
STEP    19 / 47 f
STEP    20 / 47 d
STEP    21 / 47 f
STEP    22 / 47 d
STEP    23 / 47 f
STEP    24 / 47 f
STEP    25 / 47 d
Reallocating..done. *alloclen = 1815

STEP    26 / 47 d
STEP    27 / 47 d
STEP    28 / 47 d
STEP    29 / 47 f
STEP    30 / 47 f
STEP    31 / 47 d
STEP    32 / 47 f
STEP    33 / 47 d
STEP    34 / 47 d
STEP    35 / 47 d
STEP    36 / 47 d
STEP    37 / 47 d
STEP    38 / 47 d
STEP    39 / 47 d
STEP    40 / 47 f
STEP    41 / 47 d
STEP    42 / 47 d
STEP    43 / 47 f
STEP    44 / 47 d
STEP    45 / 47 d
STEP    46 / 47 d
STEP    47 / 47 d
done.

disttbfast (nuc) Version 7.271 alg=A, model=DNA200 (2), 1.53 (4.59), -0.00 (-0.00), noshift, amax=0.0
0 thread(s)


Strategy:
 FFT-NS-2 (Fast but rough)
 Progressive method (guide trees were built 2 times.)

If unsure which option to use, try 'mafft --auto input > output'.
For more information, see 'mafft --help', 'mafft --man' and the mafft page.

The default gap scoring scheme has been changed in version 7.110 (2013 Oct).
It tends to insert more gaps into gap-rich regions than previous versions.
To disable this change, add the --leavegappyregion option.


> system(paste0("clustalo -i ", "its.fasta", " --force -o ", "../30_alignments/", "its_clustalo.fasta", " -v"))
Using 8 threads
Read 48 sequences (type: DNA) from its.fasta
not more sequences (48) than cluster-size (100), turn off mBed
Calculating pairwise ktuple-distances...
Ktuple-distance calculation progress: 0 % (0 out of 1176)
Ktuple-distance calculation progress: 10 % (118 out of 1176)
Ktuple-distance calculation progress: 11 % (141 out of 1176)
Ktuple-distance calculation progress: 19 % (231 out of 1176)
Ktuple-distance calculation progress: 21 % (258 out of 1176)
Ktuple-distance calculation progress: 22 % (265 out of 1176)
Ktuple-distance calculation progress: 23 % (280 out of 1176)
Ktuple-distance calculation progress: 24 % (283 out of 1176)
Ktuple-distance calculation progress: 31 % (370 out of 1176)
Ktuple-distance calculation progress: 36 % (426 out of 1176)
Ktuple-distance calculation progress: 37 % (437 out of 1176)
Ktuple-distance calculation progress: 40 % (473 out of 1176)
Ktuple-distance calculation progress: 44 % (521 out of 1176)
Ktuple-distance calculation progress: 46 % (551 out of 1176)
Ktuple-distance calculation progress: 47 % (563 out of 1176)
Ktuple-distance calculation progress: 48 % (574 out of 1176)
Ktuple-distance calculation progress: 49 % (581 out of 1176)
Ktuple-distance calculation progress: 54 % (646 out of 1176)
Ktuple-distance calculation progress: 55 % (652 out of 1176)
Ktuple-distance calculation progress: 60 % (712 out of 1176)
Ktuple-distance calculation progress: 61 % (725 out of 1176)
Ktuple-distance calculation progress: 66 % (780 out of 1176)
Ktuple-distance calculation progress: 67 % (790 out of 1176)
Ktuple-distance calculation progress: 68 % (800 out of 1176)
Ktuple-distance calculation progress: 71 % (840 out of 1176)
Ktuple-distance calculation progress: 72 % (853 out of 1176)
Ktuple-distance calculation progress: 76 % (901 out of 1176)
Ktuple-distance calculation progress: 79 % (938 out of 1176)
Ktuple-distance calculation progress: 81 % (961 out of 1176)
Ktuple-distance calculation progress: 82 % (965 out of 1176)
Ktuple-distance calculation progress: 83 % (982 out of 1176)
Ktuple-distance calculation progress: 84 % (991 out of 1176)
Ktuple-distance calculation progress: 85 % (1009 out of 1176)
Ktuple-distance calculation progress: 88 % (1035 out of 1176)
Ktuple-distance calculation progress: 90 % (1060 out of 1176)
Ktuple-distance calculation progress: 92 % (1085 out of 1176)
Ktuple-distance calculation progress done. CPU time: 0.25u 0.00s 00:00:00.25 Elapsed: 00:00:00
Guide-tree computation done.
Progressive alignment progress: 2 % (1 out of 47)
Progressive alignment progress: 4 % (2 out of 47)
Progressive alignment progress: 6 % (3 out of 47)
Progressive alignment progress: 8 % (4 out of 47)
Progressive alignment progress: 10 % (5 out of 47)
Progressive alignment progress: 12 % (6 out of 47)
Progressive alignment progress: 14 % (7 out of 47)
Progressive alignment progress: 17 % (8 out of 47)
Progressive alignment progress: 19 % (9 out of 47)
Progressive alignment progress: 21 % (10 out of 47)
Progressive alignment progress: 23 % (11 out of 47)
Progressive alignment progress: 25 % (12 out of 47)
Progressive alignment progress: 27 % (13 out of 47)
Progressive alignment progress: 29 % (14 out of 47)
Progressive alignment progress: 31 % (15 out of 47)
Progressive alignment progress: 34 % (16 out of 47)
Progressive alignment progress: 36 % (17 out of 47)
Progressive alignment progress: 38 % (18 out of 47)
Progressive alignment progress: 40 % (19 out of 47)
Progressive alignment progress: 42 % (20 out of 47)
Progressive alignment progress: 44 % (21 out of 47)
Progressive alignment progress: 46 % (22 out of 47)
Progressive alignment progress: 48 % (23 out of 47)
Progressive alignment progress: 51 % (24 out of 47)
Progressive alignment progress: 53 % (25 out of 47)
Progressive alignment progress: 55 % (26 out of 47)
Progressive alignment progress: 57 % (27 out of 47)
Progressive alignment progress: 59 % (28 out of 47)
Progressive alignment progress: 61 % (29 out of 47)
Progressive alignment progress: 63 % (30 out of 47)
Progressive alignment progress: 65 % (31 out of 47)
Progressive alignment progress: 68 % (32 out of 47)
Progressive alignment progress: 70 % (33 out of 47)
Progressive alignment progress: 72 % (34 out of 47)
Progressive alignment progress: 74 % (35 out of 47)
Progressive alignment progress: 76 % (36 out of 47)
Progressive alignment progress: 78 % (37 out of 47)
Progressive alignment progress: 80 % (38 out of 47)
Progressive alignment progress: 82 % (39 out of 47)
Progressive alignment progress: 85 % (40 out of 47)
Progressive alignment progress: 87 % (41 out of 47)
Progressive alignment progress: 89 % (42 out of 47)
Progressive alignment progress: 91 % (43 out of 47)
Progressive alignment progress: 93 % (44 out of 47)
Progressive alignment progress: 95 % (45 out of 47)
Progressive alignment progress: 97 % (46 out of 47)
Progressive alignment progress: 100 % (47 out of 47)
Progressive alignment progress done. CPU time: 0.74u 0.00s 00:00:00.74 Elapsed: 00:00:01
Alignment written to ../30_alignments/its_clustalo.fasta

> setwd("..")

> setwd("30_alignments")

> dna <- structure(vector("list", 2), names=c("its_mafft", "its_clustalo"))

> for (f in names(dna)) {
+ dna[[f]] <- Read.fasta(paste0(f, ".fasta"))
+ bb <- do.call(rbind, strsplit(dna[[f]]$sequence, split=""))
+ dd <- apply(bb, 2, function(.x) sum(.x == "-")/nrow(bb))
+ ee <- runmed(dd, 3) < 0.5 # trimming treshold: three subsequent sequence positions have more then 50% of non-gaps
+ left <- min(which(ee == TRUE))
+ right <- max(which(ee == TRUE))
+ ff <- bb[,left:right]
+ dna[[f]]$sequence <- apply(ff, 1, paste, collapse="")
+ Write.fasta(dna[[f]], file=paste0("../31_alignments_trimmed/", f, ".fasta"))
+ }

> setwd("..")

> setwd("31_alignments_trimmed")

> dna <- structure(vector("list", 3), names=c("its", "its_mafft", "its_clustalo"))

> for (f in names(dna)) {
+ dna[[f]] <- Read.fasta(paste0(f, ".fasta"))
+ dna[[f]]$sequence <- toupper(dna[[f]]$sequence)
+ dna[[f]] <- dna[[f]][order(dna[[f]]$name), ]
+ }

> dna.new <- data.frame(name=dna[[1]]$name, sequence=do.call(paste0, lapply(dna, `[[`, "sequence")))

> Write.fasta(dna.new, file="its.fasta") # !!! overwrite "its"

> setwd("..")
