text:
computing the distance between ( XYZ coordinates)
I have a txt file (50k) proteins in it, which looks like this:
line 1:the protein code
line 2: protein length in amino acids
line 3: amino acid sequence
line 4: secondary structure
line 5: XYZ coordinates(which is numbers).
line 6:embty
the input looks like this :

4LGTD
247
M       S       E       K       L       Q       K       V       L       A       R       A       G       H       G       S       R   T
.       .       E       E       H       H       H       H       H       H       H       T       T       S       S       .       H   .
-34.3 -28.9 16.3        -33.0 -26.8 13.4        -29.4 -25.4 13.3        -27.9 -22.6 11.2        -26.9 -24.1 7.8 -23.3 -22.9 8.2 -23.0 -24.7 11.5     -24.1 -27.9 9.9 -21.8 -27.7 6.9 -18.8 -26.7 9.0 -19.5 -29.7 11.3        -19.6 -31.9 8.2 -16.2 -30.7 7.2 -16.7 -28.2 4.4      -15.0 -25.1 5.8 -15.4 -22.7 8.7 -18.8 -21.3 9.7 -17.7 -17.9 8.3 -16.3 -19.3 5.1 -19.5 -21.2 4.5 -21.5 -18.0 5.1 -19.7 -16.2 2.3      -20.8 -19.1 -0.0        -24.4 -19.2 1.2 -24.6 -15.4 0.6 -23.5 -16.0 -3.0        -26.4 -18.4 -3.6        -24.1 -21.4 -4.0    -25.9 -23.6 -1.5 -29.3 -25.2 -2.0        -31.4 -27.0 0.5 -34.0 -29.5 -0.8        -33.9 -27.8 -4.2        -34.1 -24.2 -3.0        -31.3 -21.7 -2.9     -30.7 -21.0 0.8 -30.2 -17.5 2.2 -27.9 -16.3 4.9 -29.4 -17.1 8.3 -31.3 -20.1 7.0 -31.7 -23.1 9.4 -32.1 -26.8 8.7 -32.6 -30.1 10.5     -30.2 -32.9 9.7 -32.0 -36.0 8.4 -31.6 -38.7 5.7 -34.0 -36.6 3.6 -32.0 -33.4 3.7 -30.4 -32.7 0.4 -27.7 -30.0 0.6 -25.8 -29.0 -2.5     -23.0 -26.6 -3.0        -22.5 -25.6 -6.6        -25.0 -28.3 -7.5        -22.9 -31.1 -5.9        -24.6 -33.1 -3.2    -23.0 -33.1 0.2  -23.1 -36.0 2.6 -23.7 -34.9 6.2 -23.8 -36.9 9.4 -27.2 -37.3 11.1        -28.5 -37.1 14.7        -19.2 -38.7 17.8    -17.7 -36.6 20.6 -14.0 -37.3 20.3        -11.2 -35.4 22.0        -7.4 -35.3 21.2 -4.7 -34.3 23.6 -1.9 -32.6 21.6 1.6 -31.6 22.7  2.2 -28.4 20.7       5.8 -27.5 20.1  7.1 -23.9 19.9  7.1 -22.6 16.3  3.6 -24.0 15.4  0.7 -21.6 14.7  -2.8 -22.2 16.0 -4.8 -21.4 12.8 -6.4 -23.3 9.9       -4.8 -20.9 7.5  -1.6 -18.8 8.1  -1.1 -16.0 5.5  2.7 -16.4 6.0   3.0 -20.1 5.2   4.2 -21.3 8.7   3.5 -24.7 10.3  0.1 -24.9 11.9       -1.1 -27.3 14.7 -3.6 -28.9 12.3 -1.0 -30.0 9.8  -0.7 -33.4 11.5 -4.0 -34.7 12.9 -6.1 -37.9 12.3 -8.5 -37.7 9.3  -12.2 -38.1 10.1     -15.3 -39.0 8.2 -17.5 -36.0 7.6 -16.2 -34.0 10.6        -13.2 -31.8 11.6        -10.9 -31.0 14.5        -11.7 -27.8 16.4     -8.8 -26.3 18.5 -9.8 -25.6 22.1 -8.4 -22.1 22.1 -5.0 -20.9 20.9 -1.5 -21.1 22.2 1.2 -18.6 21.2  3.8 -19.7 18.6  6.6 -20.0 21.1       4.5 -21.3 23.9  4.7 -25.1 24.5  2.3 -27.7 25.8  -1.3 -29.0 25.9 -3.8 -28.1 23.2 -7.0 -30.0 23.1 -8.9 -30.7 19.9 -12.5 -32.0 19.6     -14.9 -32.8 16.9        -17.6 -31.5 19.2        -17.9 -27.7 18.8        -20.2 -27.3 21.8        -17.6 -29.0 24.0        -15.0 -26.8 22.4     -16.8 -23.5 23.1        -17.7 -24.6 26.6        -14.1 -25.3 27.4        -12.9 -21.9 26.0        -15.6 -19.6 27.2    -14.8 -18.2 30.6 -18.4 -18.5 31.9        -17.5 -22.1 32.5        -14.3 -21.2 34.4        -12.2 -24.1 33.1        -8.7 -24.1 34.5 -5.7 -23.6 32.3      -2.5 -24.5 34.2 0.9 -23.2 33.2  4.4 -23.9 34.3  6.1 -20.6 34.0  9.8 -20.0 34.3  10.1 -16.4 35.4 13.0 -14.0 35.5 13.3 -11.2 38.1      12.7 -10.5 41.8 9.7 -12.2 43.3  8.4 -12.0 46.8  5.2 -13.0 48.6  3.7 -9.5 48.4   3.8 -9.8 44.6   2.2 -13.2 44.8  -0.6 -11.7 47.0      -1.0 -8.9 44.5  -1.3 -11.3 41.5 -3.9 -13.4 43.4 -6.1 -10.5 44.4 -6.1 -8.6 41.1  -3.9 -6.2 39.3  -4.5 -3.7 36.4  -3.6 -4.8 32.9       -3.8 -2.6 29.8  -7.0 -4.4 29.0  -8.5 -4.4 32.5  -8.2 -6.2 35.8  -6.8 -9.7 35.9  -5.7 -12.2 38.6 -4.2 -15.6 38.7 -6.6 -18.1 40.2      -3.8 -20.0 41.8 -0.0 -19.4 42.0 2.4 -21.9 43.4  6.2 -21.7 43.7  7.6 -24.7 41.8  11.4 -24.5 42.2 14.2 -22.0 42.2 17.4 -20.5 41.0      18.6 -17.0 41.7 16.7 -14.6 39.4 15.1 -17.6 37.8 12.2 -19.4 39.4 9.4 -21.8 38.3  5.8 -21.1 39.2  2.7 -23.1 38.4  -0.3 -20.8 37.8      -3.8 -21.1 36.7 -6.3 -18.9 34.9 -9.9 -19.4 34.1 -9.9 -17.1 31.1 -7.6 -16.7 28.1 -6.8 -13.1 27.2 -4.0 -12.5 24.7 -0.6 -13.1 26.3      -2.2 -12.9 29.7 0.3 -14.9 31.8  3.2 -12.8 30.5  1.3 -9.5 31.1   0.4 -10.5 34.6  4.0 -11.2 35.6  5.1 -8.0 33.8   2.5 -6.0 35.8        4.6 -6.8 38.9   8.0 -6.3 37.2   8.8 -9.9 36.2   9.7 -11.4 32.9  8.9 -14.8 31.5  11.6 -17.1 30.0 9.5 -20.2 29.5  5.8 -21.0 29.3       4.3 -24.5 29.1  0.6 -25.3 29.3  0.5 -28.5 31.4  -3.2 -28.9 32.0 -6.5 -27.9 30.5 -9.5 -28.7 32.7 -9.1 -32.2 34.0 -6.7 -33.3 31.2      -3.0 -32.9 32.1 -0.4 -33.0 29.4 -0.1 -36.8 28.8 2.9 -38.3 30.7  4.2 -40.6 28.0  3.5 -38.2 25.2  6.4 -36.4 23.5  6.5 -32.9 22.0       4.6 -32.8 18.6  2.5 -35.9 19.2  -1.1 -36.5 20.3 -3.4 -39.1 21.9 -7.1 -39.7 22.0 -9.2 -39.8 25.2 -11.5 -42.8 25.8    -15.2 -42.7 26.7 -14.8 -42.3 30.4        -12.3 -39.5 30.0        -14.2 -37.7 27.3        -17.3 -38.0 29.6        -15.4 -36.5 32.6    -14.3 -33.6 30.4 -17.9 -33.1 29.4        -19.2 -33.2 33.0        -16.7 -30.4 33.8        -18.7 -28.1 31.6        -22.2 -29.4 32.6    -22.6 -31.6 29.5 -24.2 -35.0 30.3        -22.3 -38.2 29.6        -22.5 -39.9 26.3        -22.8 -43.7 25.4

1XXIJ
334
M       R       W       Y       P       W       L       R       P       D       F       E       K       L       V       A       S   L
.       .       .       .       T       T       H       H       H       H       H       H       H       H       H       T       T   .
65.7 -16.7 128.5        64.5 -19.9 130.3        66.9 -22.7 131.5        66.0 -25.8 129.7        67.1 -29.4 130.9        69.2 -30.4 127.8     71.4 -27.4 128.6        72.9 -29.3 131.5        75.3 -32.0 130.1        76.9 -29.2 128.1        76.9 -26.7 131.0        78.6 -29.4 133.1     81.8 -29.7 131.1        81.8 -26.0 130.4        82.2 -25.2 134.1        84.3 -28.3 134.6        87.0 -26.5 132.5    86.5 -23.1 134.2 87.2 -24.8 137.5        90.3 -26.9 136.4        91.9 -24.1 134.3        91.2 -25.8 130.9        88.8 -22.9 130.1    88.9 -21.4 126.6 89.0 -17.6 126.7        86.9 -17.5 123.5        83.8 -19.6 123.0        81.6 -19.9 119.9        78.4 -21.8 120.5    76.4 -23.0 117.5 72.8 -23.9 117.9        69.4 -23.9 116.3        66.9 -21.3 117.2        65.1 -21.8 120.5        67.7 -24.4 121.7    68.4 -22.5 124.8 71.4 -20.9 123.2        70.2 -17.9 125.1        70.3 -19.4 128.5        73.6 -21.3 128.3        75.7 -18.2 127.8    74.1 -16.3 130.7 74.1 -19.4 133.0        77.8 -19.8 132.3        78.8 -16.2 133.0        77.0 -16.2 136.4        79.4 -18.9 137.5    82.4 -16.9 136.6 81.1 -13.6 138.0        80.6 -14.9 141.5        82.7 -13.6 144.4        81.9 -16.6 146.7        80.7 -19.6 144.5    79.2 -22.6 146.2 80.7 -25.3 143.9        78.7 -25.6 140.7        76.6 -22.5 141.0        76.6 -19.1 142.8        75.6 -18.0 146.3    73.1 -15.2 145.4 74.5 -12.7 148.0        78.0 -11.6 146.9        78.5 -8.3 145.0 78.7 -10.2 141.8        75.6 -12.3 142.3        73.7 -9.2 143.5      74.8 -6.8 140.8 74.2 -9.8 138.5 70.6 -10.2 139.7        70.4 -6.4 139.2 71.7 -7.1 135.7 74.0 -4.0 135.8 77.6 -5.1 136.4      81.1 -3.7 135.7 82.4 -7.0 134.2 79.5 -8.2 132.2 79.4 -6.7 128.7 76.5 -7.3 126.2 77.5 -6.8 122.6 74.1 -6.4 121.0 74.1 -5.1 117.4      73.4 -1.3 116.8 69.7 -0.7 117.7 67.9 -0.2 114.4 70.3 -1.8 112.0 70.7 -5.6 111.3 74.4 -5.6 111.8 77.1 -4.7 114.4 79.7 -1.9 114.3      83.5 -1.7 114.3 82.9 1.0 117.0  81.1 -1.0 119.7 83.9 -3.6 119.5 86.8 -1.2 119.9 85.1 0.5 122.9  84.7 -2.8 124.7 88.3 -3.9 123.7      89.8 -0.9 125.5 87.2 -1.3 128.2 88.8 -4.6 129.1 92.3 -3.2 128.8 91.9 -1.8 132.3 91.6 -3.7 135.7 88.3 -5.5 136.6 86.3 -3.2 138.9      85.3 -6.1 141.2 88.7 -7.8 141.0 88.2 -11.1 139.2        87.1 -12.3 135.8        85.6 -10.1 132.9        83.1 -11.6 130.4    81.8 -10.7 126.9 78.9 -12.0 124.9        77.8 -11.6 121.3        74.2 -12.0 120.1        75.2 -13.4 116.7        78.7 -13.1 115.2    77.5 -13.8 111.7 75.7 -10.4 111.7        78.8 -8.2 112.1 80.6 -5.9 109.6 83.7 -7.5 107.9 85.8 -4.8 109.5 84.2 -5.5 112.9 85.6 -9.1 112.6      89.2 -8.1 112.3 88.8 -5.4 114.9 87.8 -8.1 117.3 90.6 -10.6 116.4        93.6 -8.6 117.7 92.2 -8.7 121.2 91.9 -12.5 121.2    95.5 -12.5 120.1 96.5 -10.2 123.0        94.2 -11.8 125.7        93.9 -9.5 128.8 94.7 -11.9 131.7        91.7 -13.9 133.1        89.1 -12.4 130.8     86.3 -14.5 129.1        84.5 -14.4 125.7        81.3 -15.9 124.4        80.5 -15.9 120.7        77.3 -17.4 119.5    76.0 -18.2 116.0 73.5 -20.3 114.2        75.8 -20.6 111.2        79.5 -20.8 112.0        80.6 -21.2 108.4        79.5 -17.8 107.3    82.1 -16.6 109.9 85.7 -15.6 109.1        87.9 -18.7 109.1        90.7 -16.8 110.8        88.2 -15.8 113.5        86.5 -19.2 114.1    90.0 -20.6 114.6 90.7 -18.5 117.7        87.6 -19.7 119.5        86.5 -23.1 120.6        83.4 -24.2 118.7        80.9 -26.1 120.8    77.9 -27.9 119.3 74.6 -27.5 121.1        73.0 -30.7 119.6        69.2 -30.8 118.8        68.0 -33.4 121.2        66.8 -36.7 119.7    63.3 -36.2 118.3 61.6 -38.6 120.7        62.8 -36.6 123.6        61.9 -33.2 122.0        58.4 -34.3 121.2        57.6 -35.6 124.7    59.0 -32.4 126.2 56.8 -30.5 123.8        53.6 -32.5 124.5        53.8 -30.9 127.9        54.2 -27.3 126.9        51.2 -27.5 124.5    48.6 -30.1 123.9 48.5 -30.9 120.2        48.7 -34.1 118.1        52.2 -35.6 118.2        52.1 -35.5 114.4        51.8 -31.8 114.5    54.3 -31.6 117.3 56.9 -33.4 115.1        56.1 -31.1 112.2        56.9 -28.0 114.3        60.2 -29.7 115.5        61.2 -30.5 111.9    60.2 -27.0 110.8 62.8 -25.7 113.3        65.7 -27.9 112.4        65.1 -29.8 115.6        65.1 -26.7 117.9        62.5 -27.5 120.5    62.4 -23.9 121.6 61.6 -22.5 118.2        59.2 -25.4 117.7        57.4 -24.4 120.9        57.2 -20.8 119.7        55.7 -22.0 116.5    52.5 -22.6 118.4 52.3 -19.7 120.9        51.0 -17.2 118.3        48.2 -18.8 116.5        50.9 -19.8 114.0        50.0 -23.4 113.8    46.4 -22.5 113.1 47.8 -20.1 110.4        49.7 -23.1 109.1        46.6 -25.3 109.0        45.0 -22.6 106.8        47.8 -23.0 104.4    47.6 -26.8 104.0 43.8 -26.5 103.4        44.3 -24.0 100.7        47.1 -26.1 99.2 44.9 -29.2 99.2 42.3 -27.4 97.2 44.7 -26.0 94.7 46.9 -29.1 94.1      44.1 -31.1 92.5 42.2 -28.1 91.1 45.1 -26.2 89.4 43.8 -22.9 90.9 47.0 -22.0 92.7 46.0 -18.4 92.8 43.6 -19.4 95.6 46.6 -19.4 98.0      46.7 -15.7 97.7 44.6 -15.2 100.8        46.6 -17.8 102.7        50.0 -16.3 101.8        49.4 -12.6 101.4        50.1 -11.5 104.9     53.0 -9.8 106.8 54.0 -13.4 107.8        54.5 -14.0 104.1        58.1 -15.2 104.4        57.5 -17.6 107.2        54.6 -18.9 105.2     56.4 -19.2 101.9        59.0 -21.3 103.7        56.2 -23.6 105.0        55.0 -24.0 101.4        58.6 -24.8 100.4    59.0 -27.6 102.9 56.0 -29.3 101.4        57.5 -28.8 97.9 60.7 -30.3 99.0 59.0 -33.4 100.5        57.0 -34.1 97.3 60.3 -33.9 95.5 62.0 -36.3 97.9      59.2 -38.8 97.5 59.9 -39.0 93.7 63.3 -40.3 94.6 61.9 -42.6 97.2 63.3 -40.7 100.2        62.2 -42.2 103.5        62.3 -39.0 105.6     59.6 -36.3 105.3        59.3 -33.1 107.2        55.6 -32.7 106.8        54.4 -35.9 108.5        51.5 -33.8 109.6    49.8 -34.3 106.2 51.3 -37.2 104.2        48.2 -37.2 102.1        49.2 -33.8 100.8        52.8 -34.5 99.9 51.5 -37.6 98.1 48.9 -36.0 95.9      51.3 -33.1 95.3 54.0 -35.5 94.1 51.3 -37.3 92.0 50.2 -34.2 90.0 53.6 -32.6 89.7 56.6 -34.0 87.9 59.9 -33.8 89.7 60.9 -31.0 87.3      57.8 -28.9 87.8 58.3 -29.2 91.5 62.0 -28.0 91.2 60.8 -25.0 89.2 58.2 -24.0 91.7 60.5 -24.7 94.7 62.8 -22.0 93.4 60.4 -19.2 92.5      58.9 -19.8 95.9 62.4 -19.6 97.2 63.7 -16.5 95.4 60.4 -14.7 95.9 60.3 -15.3 99.6 63.7 -13.7 99.7 62.8 -10.5 97.9 60.1 -10.1 100.5     62.5 -10.4 103.3        65.4 -8.5 101.8 64.0 -5.6 99.5  62.8 -2.7 101.7 59.2 -2.6 100.6 57.9 -4.3 97.4  54.2 -5.0 96.9  53.5 -8.2 98.9       50.4 -8.5 96.9  51.8 -8.1 93.4  54.8 -10.2 93.8 52.9 -13.1 95.2 50.1 -12.8 92.6 52.9 -13.0 90.1 54.5 -16.0 91.9 51.1 -17.7 91.9      50.0 -17.1 88.3 53.5 -18.0 87.3 53.3 -21.3 89.1 50.3 -22.1 87.0 52.1 -21.6 83.7 54.8 -24.0 84.7 52.0 -26.5 85.2 50.8 -26.1 81.6      52.0 -28.7 79.0 54.8 -27.5 76.7 56.2 -24.8 78.9 60.0 -24.6 79.4 60.6 -24.0 83.1 63.6 -22.0 84.5 67.2 -23.0 85.4 69.4 -21.4 88.1      71.8 -18.6 87.1 75.6 -17.8 87.3

and so on (the same structure)
Please note in  line 5; There is a space between x
and y and y and z, but each XYZ group is tab-separated from the next.
Now  I am unsure if the code down works and computing the distance between ( XYZ coordinates) correctly or not!
awk '
NR%6==5 { printf "%f\n", sqrt(($1-x)^2 + ($2-y)^2 + ($3-z)^2) }
       { x=$1; y=$2; z=$3 }' myfile.adataset

But I want the output to be like this, which is to print also the lines 1,2,3,4 , and the results:
4LGTD
247
M       S       E       K       L       Q       K       V       L
.       .       E       E       H       H       H       H       H
the result

1XXIJ
334
M       R       W       Y       P       W       L       R       P
        T       T       H       H       H       H       H
the result

and so on

So after that, I want other code to delete blocks of lines(1,2,3,4,5)if the results of XYZ coordinates are bigger than (4.5)?
Any suggestions  code for first computing the distance and then deleting if the line 5 result is bigger than 4.5 by awk to do this?

Duplicate with https://askubuntu.com/questions/1455964/how-to-delete-each-proteins-blocks-of-lines1-2-3-4-5if-the-results-of-xyz-coor
Same problems

NR%5==5 condition is always false. NR%5 is always between 0 and 4

All of rows in example contain only one column. So math expression with $1, $2 and $3 never works fine

Which rows you mean? In second rew i have so many letters each of them is column .when I print column 1 it gives me just one letter in the second row

with awk command, columns are (by default) separated by space or tabulation

It’s separated by space

Not in your question sample. You have only one number for each 5 lines block: 30.6 for the first, 60.0 for the second and 20.5 for the third.

Oh yea the output from my code above is just one column

The input (partially) is really important to reproduce your problem. The real code you have written is also important. Please edit your question and fix it

I want the results which is my output to be replaced in the line 5 of each  block of 5 lines.So i can sort each  protein block of lines if line 5 is less than 40.10 is it possible?!

We need to save in memory each block of 5 lines (NR%5 between 1 and 4), computing number on 5th line (NR%5 == 0), I think, and print the saved block if the result if less or equal to 40.1. Without input sample it's a little difficult for me to explain or propose a better solution

You mean not print the result just save it and print just if line 5 less or equal 40.1 ! But how can I modify the code to do it in this way?

The alternative approach is PFAM Stockholm format and parse this via Biopython, but I don't know how you import coordinates via this format (but can probably do it). It will do the secondary structure.

Based on the example you've provided, your awk command is returning an incorrect result (XY problem), however one potential answer to your question is to print your desired outcome using two clauses:
NR%6==0 (i.e. every 6 lines: 5 lines and 1 blank line) {do action}
and
NR%6!=0 (i.e. every other line) {do different action}.

Example data:
cat test.txt

4LGTD
247
M       S       E       K       L       Q       K       V       L       A       R       A       G       H       G       S       R   T
.       .       E       E       H       H       H       H       H       H       H       T       T       S       S       .       H   .
-34.3 -28.9 16.3        -33.0 -26.8 13.4        -29.4 -25.4 13.3        -27.9 -22.6 11.2        -26.9 -24.1 7.8 -23.3 -22.9 8.2 -23.0 -24.7 11.5     -24.1 -27.9 9.9 -21.8 -27.7 6.9 -18.8 -26.7 9.0 -19.5 -29.7 11.3        -19.6 -31.9 8.2 -16.2 -30.7 7.2 -16.7 -28.2 4.4      -15.0 -25.1 5.8 -15.4 -22.7 8.7 -18.8 -21.3 9.7 -17.7 -17.9 8.3 -16.3 -19.3 5.1 -19.5 -21.2 4.5 -21.5 -18.0 5.1 -19.7 -16.2 2.3      -20.8 -19.1 -0.0        -24.4 -19.2 1.2 -24.6 -15.4 0.6 -23.5 -16.0 -3.0        -26.4 -18.4 -3.6        -24.1 -21.4 -4.0    -25.9 -23.6 -1.5 -29.3 -25.2 -2.0        -31.4 -27.0 0.5 -34.0 -29.5 -0.8        -33.9 -27.8 -4.2        -34.1 -24.2 -3.0        -31.3 -21.7 -2.9     -30.7 -21.0 0.8 -30.2 -17.5 2.2 -27.9 -16.3 4.9 -29.4 -17.1 8.3 -31.3 -20.1 7.0 -31.7 -23.1 9.4 -32.1 -26.8 8.7 -32.6 -30.1 10.5     -30.2 -32.9 9.7 -32.0 -36.0 8.4 -31.6 -38.7 5.7 -34.0 -36.6 3.6 -32.0 -33.4 3.7 -30.4 -32.7 0.4 -27.7 -30.0 0.6 -25.8 -29.0 -2.5     -23.0 -26.6 -3.0        -22.5 -25.6 -6.6        -25.0 -28.3 -7.5        -22.9 -31.1 -5.9        -24.6 -33.1 -3.2    -23.0 -33.1 0.2  -23.1 -36.0 2.6 -23.7 -34.9 6.2 -23.8 -36.9 9.4 -27.2 -37.3 11.1        -28.5 -37.1 14.7        -19.2 -38.7 17.8    -17.7 -36.6 20.6 -14.0 -37.3 20.3        -11.2 -35.4 22.0        -7.4 -35.3 21.2 -4.7 -34.3 23.6 -1.9 -32.6 21.6 1.6 -31.6 22.7  2.2 -28.4 20.7       5.8 -27.5 20.1  7.1 -23.9 19.9  7.1 -22.6 16.3  3.6 -24.0 15.4  0.7 -21.6 14.7  -2.8 -22.2 16.0 -4.8 -21.4 12.8 -6.4 -23.3 9.9       -4.8 -20.9 7.5  -1.6 -18.8 8.1  -1.1 -16.0 5.5  2.7 -16.4 6.0   3.0 -20.1 5.2   4.2 -21.3 8.7   3.5 -24.7 10.3  0.1 -24.9 11.9       -1.1 -27.3 14.7 -3.6 -28.9 12.3 -1.0 -30.0 9.8  -0.7 -33.4 11.5 -4.0 -34.7 12.9 -6.1 -37.9 12.3 -8.5 -37.7 9.3  -12.2 -38.1 10.1     -15.3 -39.0 8.2 -17.5 -36.0 7.6 -16.2 -34.0 10.6        -13.2 -31.8 11.6        -10.9 -31.0 14.5        -11.7 -27.8 16.4     -8.8 -26.3 18.5 -9.8 -25.6 22.1 -8.4 -22.1 22.1 -5.0 -20.9 20.9 -1.5 -21.1 22.2 1.2 -18.6 21.2  3.8 -19.7 18.6  6.6 -20.0 21.1       4.5 -21.3 23.9  4.7 -25.1 24.5  2.3 -27.7 25.8  -1.3 -29.0 25.9 -3.8 -28.1 23.2 -7.0 -30.0 23.1 -8.9 -30.7 19.9 -12.5 -32.0 19.6     -14.9 -32.8 16.9        -17.6 -31.5 19.2        -17.9 -27.7 18.8        -20.2 -27.3 21.8        -17.6 -29.0 24.0        -15.0 -26.8 22.4     -16.8 -23.5 23.1        -17.7 -24.6 26.6        -14.1 -25.3 27.4        -12.9 -21.9 26.0        -15.6 -19.6 27.2    -14.8 -18.2 30.6 -18.4 -18.5 31.9        -17.5 -22.1 32.5        -14.3 -21.2 34.4        -12.2 -24.1 33.1        -8.7 -24.1 34.5 -5.7 -23.6 32.3      -2.5 -24.5 34.2 0.9 -23.2 33.2  4.4 -23.9 34.3  6.1 -20.6 34.0  9.8 -20.0 34.3  10.1 -16.4 35.4 13.0 -14.0 35.5 13.3 -11.2 38.1      12.7 -10.5 41.8 9.7 -12.2 43.3  8.4 -12.0 46.8  5.2 -13.0 48.6  3.7 -9.5 48.4   3.8 -9.8 44.6   2.2 -13.2 44.8  -0.6 -11.7 47.0      -1.0 -8.9 44.5  -1.3 -11.3 41.5 -3.9 -13.4 43.4 -6.1 -10.5 44.4 -6.1 -8.6 41.1  -3.9 -6.2 39.3  -4.5 -3.7 36.4  -3.6 -4.8 32.9       -3.8 -2.6 29.8  -7.0 -4.4 29.0  -8.5 -4.4 32.5  -8.2 -6.2 35.8  -6.8 -9.7 35.9  -5.7 -12.2 38.6 -4.2 -15.6 38.7 -6.6 -18.1 40.2      -3.8 -20.0 41.8 -0.0 -19.4 42.0 2.4 -21.9 43.4  6.2 -21.7 43.7  7.6 -24.7 41.8  11.4 -24.5 42.2 14.2 -22.0 42.2 17.4 -20.5 41.0      18.6 -17.0 41.7 16.7 -14.6 39.4 15.1 -17.6 37.8 12.2 -19.4 39.4 9.4 -21.8 38.3  5.8 -21.1 39.2  2.7 -23.1 38.4  -0.3 -20.8 37.8      -3.8 -21.1 36.7 -6.3 -18.9 34.9 -9.9 -19.4 34.1 -9.9 -17.1 31.1 -7.6 -16.7 28.1 -6.8 -13.1 27.2 -4.0 -12.5 24.7 -0.6 -13.1 26.3      -2.2 -12.9 29.7 0.3 -14.9 31.8  3.2 -12.8 30.5  1.3 -9.5 31.1   0.4 -10.5 34.6  4.0 -11.2 35.6  5.1 -8.0 33.8   2.5 -6.0 35.8        4.6 -6.8 38.9   8.0 -6.3 37.2   8.8 -9.9 36.2   9.7 -11.4 32.9  8.9 -14.8 31.5  11.6 -17.1 30.0 9.5 -20.2 29.5  5.8 -21.0 29.3       4.3 -24.5 29.1  0.6 -25.3 29.3  0.5 -28.5 31.4  -3.2 -28.9 32.0 -6.5 -27.9 30.5 -9.5 -28.7 32.7 -9.1 -32.2 34.0 -6.7 -33.3 31.2      -3.0 -32.9 32.1 -0.4 -33.0 29.4 -0.1 -36.8 28.8 2.9 -38.3 30.7  4.2 -40.6 28.0  3.5 -38.2 25.2  6.4 -36.4 23.5  6.5 -32.9 22.0       4.6 -32.8 18.6  2.5 -35.9 19.2  -1.1 -36.5 20.3 -3.4 -39.1 21.9 -7.1 -39.7 22.0 -9.2 -39.8 25.2 -11.5 -42.8 25.8    -15.2 -42.7 26.7 -14.8 -42.3 30.4        -12.3 -39.5 30.0        -14.2 -37.7 27.3        -17.3 -38.0 29.6        -15.4 -36.5 32.6    -14.3 -33.6 30.4 -17.9 -33.1 29.4        -19.2 -33.2 33.0        -16.7 -30.4 33.8        -18.7 -28.1 31.6        -22.2 -29.4 32.6    -22.6 -31.6 29.5 -24.2 -35.0 30.3        -22.3 -38.2 29.6        -22.5 -39.9 26.3        -22.8 -43.7 25.4

1XXIJ
334
M       R       W       Y       P       W       L       R       P       D       F       E       K       L       V       A       S   L
.       .       .       .       T       T       H       H       H       H       H       H       H       H       H       T       T   .
65.7 -16.7 128.5        64.5 -19.9 130.3        66.9 -22.7 131.5        66.0 -25.8 129.7        67.1 -29.4 130.9        69.2 -30.4 127.8     71.4 -27.4 128.6        72.9 -29.3 131.5        75.3 -32.0 130.1        76.9 -29.2 128.1        76.9 -26.7 131.0        78.6 -29.4 133.1     81.8 -29.7 131.1        81.8 -26.0 130.4        82.2 -25.2 134.1        84.3 -28.3 134.6        87.0 -26.5 132.5    86.5 -23.1 134.2 87.2 -24.8 137.5        90.3 -26.9 136.4        91.9 -24.1 134.3        91.2 -25.8 130.9        88.8 -22.9 130.1    88.9 -21.4 126.6 89.0 -17.6 126.7        86.9 -17.5 123.5        83.8 -19.6 123.0        81.6 -19.9 119.9        78.4 -21.8 120.5    76.4 -23.0 117.5 72.8 -23.9 117.9        69.4 -23.9 116.3        66.9 -21.3 117.2        65.1 -21.8 120.5        67.7 -24.4 121.7    68.4 -22.5 124.8 71.4 -20.9 123.2        70.2 -17.9 125.1        70.3 -19.4 128.5        73.6 -21.3 128.3        75.7 -18.2 127.8    74.1 -16.3 130.7 74.1 -19.4 133.0        77.8 -19.8 132.3        78.8 -16.2 133.0        77.0 -16.2 136.4        79.4 -18.9 137.5    82.4 -16.9 136.6 81.1 -13.6 138.0        80.6 -14.9 141.5        82.7 -13.6 144.4        81.9 -16.6 146.7        80.7 -19.6 144.5    79.2 -22.6 146.2 80.7 -25.3 143.9        78.7 -25.6 140.7        76.6 -22.5 141.0        76.6 -19.1 142.8        75.6 -18.0 146.3    73.1 -15.2 145.4 74.5 -12.7 148.0        78.0 -11.6 146.9        78.5 -8.3 145.0 78.7 -10.2 141.8        75.6 -12.3 142.3        73.7 -9.2 143.5      74.8 -6.8 140.8 74.2 -9.8 138.5 70.6 -10.2 139.7        70.4 -6.4 139.2 71.7 -7.1 135.7 74.0 -4.0 135.8 77.6 -5.1 136.4      81.1 -3.7 135.7 82.4 -7.0 134.2 79.5 -8.2 132.2 79.4 -6.7 128.7 76.5 -7.3 126.2 77.5 -6.8 122.6 74.1 -6.4 121.0 74.1 -5.1 117.4      73.4 -1.3 116.8 69.7 -0.7 117.7 67.9 -0.2 114.4 70.3 -1.8 112.0 70.7 -5.6 111.3 74.4 -5.6 111.8 77.1 -4.7 114.4 79.7 -1.9 114.3      83.5 -1.7 114.3 82.9 1.0 117.0  81.1 -1.0 119.7 83.9 -3.6 119.5 86.8 -1.2 119.9 85.1 0.5 122.9  84.7 -2.8 124.7 88.3 -3.9 123.7      89.8 -0.9 125.5 87.2 -1.3 128.2 88.8 -4.6 129.1 92.3 -3.2 128.8 91.9 -1.8 132.3 91.6 -3.7 135.7 88.3 -5.5 136.6 86.3 -3.2 138.9      85.3 -6.1 141.2 88.7 -7.8 141.0 88.2 -11.1 139.2        87.1 -12.3 135.8        85.6 -10.1 132.9        83.1 -11.6 130.4    81.8 -10.7 126.9 78.9 -12.0 124.9        77.8 -11.6 121.3        74.2 -12.0 120.1        75.2 -13.4 116.7        78.7 -13.1 115.2    77.5 -13.8 111.7 75.7 -10.4 111.7        78.8 -8.2 112.1 80.6 -5.9 109.6 83.7 -7.5 107.9 85.8 -4.8 109.5 84.2 -5.5 112.9 85.6 -9.1 112.6      89.2 -8.1 112.3 88.8 -5.4 114.9 87.8 -8.1 117.3 90.6 -10.6 116.4        93.6 -8.6 117.7 92.2 -8.7 121.2 91.9 -12.5 121.2    95.5 -12.5 120.1 96.5 -10.2 123.0        94.2 -11.8 125.7        93.9 -9.5 128.8 94.7 -11.9 131.7        91.7 -13.9 133.1        89.1 -12.4 130.8     86.3 -14.5 129.1        84.5 -14.4 125.7        81.3 -15.9 124.4        80.5 -15.9 120.7        77.3 -17.4 119.5    76.0 -18.2 116.0 73.5 -20.3 114.2        75.8 -20.6 111.2        79.5 -20.8 112.0        80.6 -21.2 108.4        79.5 -17.8 107.3    82.1 -16.6 109.9 85.7 -15.6 109.1        87.9 -18.7 109.1        90.7 -16.8 110.8        88.2 -15.8 113.5        86.5 -19.2 114.1    90.0 -20.6 114.6 90.7 -18.5 117.7        87.6 -19.7 119.5        86.5 -23.1 120.6        83.4 -24.2 118.7        80.9 -26.1 120.8    77.9 -27.9 119.3 74.6 -27.5 121.1        73.0 -30.7 119.6        69.2 -30.8 118.8        68.0 -33.4 121.2        66.8 -36.7 119.7    63.3 -36.2 118.3 61.6 -38.6 120.7        62.8 -36.6 123.6        61.9 -33.2 122.0        58.4 -34.3 121.2        57.6 -35.6 124.7    59.0 -32.4 126.2 56.8 -30.5 123.8        53.6 -32.5 124.5        53.8 -30.9 127.9        54.2 -27.3 126.9        51.2 -27.5 124.5    48.6 -30.1 123.9 48.5 -30.9 120.2        48.7 -34.1 118.1        52.2 -35.6 118.2        52.1 -35.5 114.4        51.8 -31.8 114.5    54.3 -31.6 117.3 56.9 -33.4 115.1        56.1 -31.1 112.2        56.9 -28.0 114.3        60.2 -29.7 115.5        61.2 -30.5 111.9    60.2 -27.0 110.8 62.8 -25.7 113.3        65.7 -27.9 112.4        65.1 -29.8 115.6        65.1 -26.7 117.9        62.5 -27.5 120.5    62.4 -23.9 121.6 61.6 -22.5 118.2        59.2 -25.4 117.7        57.4 -24.4 120.9        57.2 -20.8 119.7        55.7 -22.0 116.5    52.5 -22.6 118.4 52.3 -19.7 120.9        51.0 -17.2 118.3        48.2 -18.8 116.5        50.9 -19.8 114.0        50.0 -23.4 113.8    46.4 -22.5 113.1 47.8 -20.1 110.4        49.7 -23.1 109.1        46.6 -25.3 109.0        45.0 -22.6 106.8        47.8 -23.0 104.4    47.6 -26.8 104.0 43.8 -26.5 103.4        44.3 -24.0 100.7        47.1 -26.1 99.2 44.9 -29.2 99.2 42.3 -27.4 97.2 44.7 -26.0 94.7 46.9 -29.1 94.1      44.1 -31.1 92.5 42.2 -28.1 91.1 45.1 -26.2 89.4 43.8 -22.9 90.9 47.0 -22.0 92.7 46.0 -18.4 92.8 43.6 -19.4 95.6 46.6 -19.4 98.0      46.7 -15.7 97.7 44.6 -15.2 100.8        46.6 -17.8 102.7        50.0 -16.3 101.8        49.4 -12.6 101.4        50.1 -11.5 104.9     53.0 -9.8 106.8 54.0 -13.4 107.8        54.5 -14.0 104.1        58.1 -15.2 104.4        57.5 -17.6 107.2        54.6 -18.9 105.2     56.4 -19.2 101.9        59.0 -21.3 103.7        56.2 -23.6 105.0        55.0 -24.0 101.4        58.6 -24.8 100.4    59.0 -27.6 102.9 56.0 -29.3 101.4        57.5 -28.8 97.9 60.7 -30.3 99.0 59.0 -33.4 100.5        57.0 -34.1 97.3 60.3 -33.9 95.5 62.0 -36.3 97.9      59.2 -38.8 97.5 59.9 -39.0 93.7 63.3 -40.3 94.6 61.9 -42.6 97.2 63.3 -40.7 100.2        62.2 -42.2 103.5        62.3 -39.0 105.6     59.6 -36.3 105.3        59.3 -33.1 107.2        55.6 -32.7 106.8        54.4 -35.9 108.5        51.5 -33.8 109.6    49.8 -34.3 106.2 51.3 -37.2 104.2        48.2 -37.2 102.1        49.2 -33.8 100.8        52.8 -34.5 99.9 51.5 -37.6 98.1 48.9 -36.0 95.9      51.3 -33.1 95.3 54.0 -35.5 94.1 51.3 -37.3 92.0 50.2 -34.2 90.0 53.6 -32.6 89.7 56.6 -34.0 87.9 59.9 -33.8 89.7 60.9 -31.0 87.3      57.8 -28.9 87.8 58.3 -29.2 91.5 62.0 -28.0 91.2 60.8 -25.0 89.2 58.2 -24.0 91.7 60.5 -24.7 94.7 62.8 -22.0 93.4 60.4 -19.2 92.5      58.9 -19.8 95.9 62.4 -19.6 97.2 63.7 -16.5 95.4 60.4 -14.7 95.9 60.3 -15.3 99.6 63.7 -13.7 99.7 62.8 -10.5 97.9 60.1 -10.1 100.5     62.5 -10.4 103.3        65.4 -8.5 101.8 64.0 -5.6 99.5  62.8 -2.7 101.7 59.2 -2.6 100.6 57.9 -4.3 97.4  54.2 -5.0 96.9  53.5 -8.2 98.9       50.4 -8.5 96.9  51.8 -8.1 93.4  54.8 -10.2 93.8 52.9 -13.1 95.2 50.1 -12.8 92.6 52.9 -13.0 90.1 54.5 -16.0 91.9 51.1 -17.7 91.9      50.0 -17.1 88.3 53.5 -18.0 87.3 53.3 -21.3 89.1 50.3 -22.1 87.0 52.1 -21.6 83.7 54.8 -24.0 84.7 52.0 -26.5 85.2 50.8 -26.1 81.6      52.0 -28.7 79.0 54.8 -27.5 76.7 56.2 -24.8 78.9 60.0 -24.6 79.4 60.6 -24.0 83.1 63.6 -22.0 84.5 67.2 -23.0 85.4 69.4 -21.4 88.1      71.8 -18.6 87.1 75.6 -17.8 87.3

Example command:
awk 'NR%6 != 0 {print} NR%6==0 {res=(sqrt(($1-x)^2 + ($2-y)^2 + ($3-z)^2)); if(res <= 4.5){printf "%f\n", res} else{print}} {x=$1; y=$2; z=$3}'

4LGTD
247
M       S       E       K       L       Q       K       V       L       A       R       A       G       H       G       S       R   T
.       .       E       E       H       H       H       H       H       H       H       T       T       S       S       .       H   .
-34.3 -28.9 16.3        -33.0 -26.8 13.4        -29.4 -25.4 13.3        -27.9 -22.6 11.2        -26.9 -24.1 7.8 -23.3 -22.9 8.2 -23.0 -24.7 11.5     -24.1 -27.9 9.9 -21.8 -27.7 6.9 -18.8 -26.7 9.0 -19.5 -29.7 11.3        -19.6 -31.9 8.2 -16.2 -30.7 7.2 -16.7 -28.2 4.4      -15.0 -25.1 5.8 -15.4 -22.7 8.7 -18.8 -21.3 9.7 -17.7 -17.9 8.3 -16.3 -19.3 5.1 -19.5 -21.2 4.5 -21.5 -18.0 5.1 -19.7 -16.2 2.3      -20.8 -19.1 -0.0        -24.4 -19.2 1.2 -24.6 -15.4 0.6 -23.5 -16.0 -3.0        -26.4 -18.4 -3.6        -24.1 -21.4 -4.0    -25.9 -23.6 -1.5 -29.3 -25.2 -2.0        -31.4 -27.0 0.5 -34.0 -29.5 -0.8        -33.9 -27.8 -4.2        -34.1 -24.2 -3.0        -31.3 -21.7 -2.9     -30.7 -21.0 0.8 -30.2 -17.5 2.2 -27.9 -16.3 4.9 -29.4 -17.1 8.3 -31.3 -20.1 7.0 -31.7 -23.1 9.4 -32.1 -26.8 8.7 -32.6 -30.1 10.5     -30.2 -32.9 9.7 -32.0 -36.0 8.4 -31.6 -38.7 5.7 -34.0 -36.6 3.6 -32.0 -33.4 3.7 -30.4 -32.7 0.4 -27.7 -30.0 0.6 -25.8 -29.0 -2.5     -23.0 -26.6 -3.0        -22.5 -25.6 -6.6        -25.0 -28.3 -7.5        -22.9 -31.1 -5.9        -24.6 -33.1 -3.2    -23.0 -33.1 0.2  -23.1 -36.0 2.6 -23.7 -34.9 6.2 -23.8 -36.9 9.4 -27.2 -37.3 11.1        -28.5 -37.1 14.7        -19.2 -38.7 17.8    -17.7 -36.6 20.6 -14.0 -37.3 20.3        -11.2 -35.4 22.0        -7.4 -35.3 21.2 -4.7 -34.3 23.6 -1.9 -32.6 21.6 1.6 -31.6 22.7  2.2 -28.4 20.7       5.8 -27.5 20.1  7.1 -23.9 19.9  7.1 -22.6 16.3  3.6 -24.0 15.4  0.7 -21.6 14.7  -2.8 -22.2 16.0 -4.8 -21.4 12.8 -6.4 -23.3 9.9       -4.8 -20.9 7.5  -1.6 -18.8 8.1  -1.1 -16.0 5.5  2.7 -16.4 6.0   3.0 -20.1 5.2   4.2 -21.3 8.7   3.5 -24.7 10.3  0.1 -24.9 11.9       -1.1 -27.3 14.7 -3.6 -28.9 12.3 -1.0 -30.0 9.8  -0.7 -33.4 11.5 -4.0 -34.7 12.9 -6.1 -37.9 12.3 -8.5 -37.7 9.3  -12.2 -38.1 10.1     -15.3 -39.0 8.2 -17.5 -36.0 7.6 -16.2 -34.0 10.6        -13.2 -31.8 11.6        -10.9 -31.0 14.5        -11.7 -27.8 16.4     -8.8 -26.3 18.5 -9.8 -25.6 22.1 -8.4 -22.1 22.1 -5.0 -20.9 20.9 -1.5 -21.1 22.2 1.2 -18.6 21.2  3.8 -19.7 18.6  6.6 -20.0 21.1       4.5 -21.3 23.9  4.7 -25.1 24.5  2.3 -27.7 25.8  -1.3 -29.0 25.9 -3.8 -28.1 23.2 -7.0 -30.0 23.1 -8.9 -30.7 19.9 -12.5 -32.0 19.6     -14.9 -32.8 16.9        -17.6 -31.5 19.2        -17.9 -27.7 18.8        -20.2 -27.3 21.8        -17.6 -29.0 24.0        -15.0 -26.8 22.4     -16.8 -23.5 23.1        -17.7 -24.6 26.6        -14.1 -25.3 27.4        -12.9 -21.9 26.0        -15.6 -19.6 27.2    -14.8 -18.2 30.6 -18.4 -18.5 31.9        -17.5 -22.1 32.5        -14.3 -21.2 34.4        -12.2 -24.1 33.1        -8.7 -24.1 34.5 -5.7 -23.6 32.3      -2.5 -24.5 34.2 0.9 -23.2 33.2  4.4 -23.9 34.3  6.1 -20.6 34.0  9.8 -20.0 34.3  10.1 -16.4 35.4 13.0 -14.0 35.5 13.3 -11.2 38.1      12.7 -10.5 41.8 9.7 -12.2 43.3  8.4 -12.0 46.8  5.2 -13.0 48.6  3.7 -9.5 48.4   3.8 -9.8 44.6   2.2 -13.2 44.8  -0.6 -11.7 47.0      -1.0 -8.9 44.5  -1.3 -11.3 41.5 -3.9 -13.4 43.4 -6.1 -10.5 44.4 -6.1 -8.6 41.1  -3.9 -6.2 39.3  -4.5 -3.7 36.4  -3.6 -4.8 32.9       -3.8 -2.6 29.8  -7.0 -4.4 29.0  -8.5 -4.4 32.5  -8.2 -6.2 35.8  -6.8 -9.7 35.9  -5.7 -12.2 38.6 -4.2 -15.6 38.7 -6.6 -18.1 40.2      -3.8 -20.0 41.8 -0.0 -19.4 42.0 2.4 -21.9 43.4  6.2 -21.7 43.7  7.6 -24.7 41.8  11.4 -24.5 42.2 14.2 -22.0 42.2 17.4 -20.5 41.0      18.6 -17.0 41.7 16.7 -14.6 39.4 15.1 -17.6 37.8 12.2 -19.4 39.4 9.4 -21.8 38.3  5.8 -21.1 39.2  2.7 -23.1 38.4  -0.3 -20.8 37.8      -3.8 -21.1 36.7 -6.3 -18.9 34.9 -9.9 -19.4 34.1 -9.9 -17.1 31.1 -7.6 -16.7 28.1 -6.8 -13.1 27.2 -4.0 -12.5 24.7 -0.6 -13.1 26.3      -2.2 -12.9 29.7 0.3 -14.9 31.8  3.2 -12.8 30.5  1.3 -9.5 31.1   0.4 -10.5 34.6  4.0 -11.2 35.6  5.1 -8.0 33.8   2.5 -6.0 35.8        4.6 -6.8 38.9   8.0 -6.3 37.2   8.8 -9.9 36.2   9.7 -11.4 32.9  8.9 -14.8 31.5  11.6 -17.1 30.0 9.5 -20.2 29.5  5.8 -21.0 29.3       4.3 -24.5 29.1  0.6 -25.3 29.3  0.5 -28.5 31.4  -3.2 -28.9 32.0 -6.5 -27.9 30.5 -9.5 -28.7 32.7 -9.1 -32.2 34.0 -6.7 -33.3 31.2      -3.0 -32.9 32.1 -0.4 -33.0 29.4 -0.1 -36.8 28.8 2.9 -38.3 30.7  4.2 -40.6 28.0  3.5 -38.2 25.2  6.4 -36.4 23.5  6.5 -32.9 22.0       4.6 -32.8 18.6  2.5 -35.9 19.2  -1.1 -36.5 20.3 -3.4 -39.1 21.9 -7.1 -39.7 22.0 -9.2 -39.8 25.2 -11.5 -42.8 25.8    -15.2 -42.7 26.7 -14.8 -42.3 30.4        -12.3 -39.5 30.0        -14.2 -37.7 27.3        -17.3 -38.0 29.6        -15.4 -36.5 32.6    -14.3 -33.6 30.4 -17.9 -33.1 29.4        -19.2 -33.2 33.0        -16.7 -30.4 33.8        -18.7 -28.1 31.6        -22.2 -29.4 32.6    -22.6 -31.6 29.5 -24.2 -35.0 30.3        -22.3 -38.2 29.6        -22.5 -39.9 26.3        -22.8 -43.7 25.4

1XXIJ
334
M       R       W       Y       P       W       L       R       P       D       F       E       K       L       V       A       S   L
.       .       .       .       T       T       H       H       H       H       H       H       H       H       H       T       T   .
65.7 -16.7 128.5        64.5 -19.9 130.3        66.9 -22.7 131.5        66.0 -25.8 129.7        67.1 -29.4 130.9        69.2 -30.4 127.8     71.4 -27.4 128.6        72.9 -29.3 131.5        75.3 -32.0 130.1        76.9 -29.2 128.1        76.9 -26.7 131.0        78.6 -29.4 133.1     81.8 -29.7 131.1        81.8 -26.0 130.4        82.2 -25.2 134.1        84.3 -28.3 134.6        87.0 -26.5 132.5    86.5 -23.1 134.2 87.2 -24.8 137.5        90.3 -26.9 136.4        91.9 -24.1 134.3        91.2 -25.8 130.9        88.8 -22.9 130.1    88.9 -21.4 126.6 89.0 -17.6 126.7        86.9 -17.5 123.5        83.8 -19.6 123.0        81.6 -19.9 119.9        78.4 -21.8 120.5    76.4 -23.0 117.5 72.8 -23.9 117.9        69.4 -23.9 116.3        66.9 -21.3 117.2        65.1 -21.8 120.5        67.7 -24.4 121.7    68.4 -22.5 124.8 71.4 -20.9 123.2        70.2 -17.9 125.1        70.3 -19.4 128.5        73.6 -21.3 128.3        75.7 -18.2 127.8    74.1 -16.3 130.7 74.1 -19.4 133.0        77.8 -19.8 132.3        78.8 -16.2 133.0        77.0 -16.2 136.4        79.4 -18.9 137.5    82.4 -16.9 136.6 81.1 -13.6 138.0        80.6 -14.9 141.5        82.7 -13.6 144.4        81.9 -16.6 146.7        80.7 -19.6 144.5    79.2 -22.6 146.2 80.7 -25.3 143.9        78.7 -25.6 140.7        76.6 -22.5 141.0        76.6 -19.1 142.8        75.6 -18.0 146.3    73.1 -15.2 145.4 74.5 -12.7 148.0        78.0 -11.6 146.9        78.5 -8.3 145.0 78.7 -10.2 141.8        75.6 -12.3 142.3        73.7 -9.2 143.5      74.8 -6.8 140.8 74.2 -9.8 138.5 70.6 -10.2 139.7        70.4 -6.4 139.2 71.7 -7.1 135.7 74.0 -4.0 135.8 77.6 -5.1 136.4      81.1 -3.7 135.7 82.4 -7.0 134.2 79.5 -8.2 132.2 79.4 -6.7 128.7 76.5 -7.3 126.2 77.5 -6.8 122.6 74.1 -6.4 121.0 74.1 -5.1 117.4      73.4 -1.3 116.8 69.7 -0.7 117.7 67.9 -0.2 114.4 70.3 -1.8 112.0 70.7 -5.6 111.3 74.4 -5.6 111.8 77.1 -4.7 114.4 79.7 -1.9 114.3      83.5 -1.7 114.3 82.9 1.0 117.0  81.1 -1.0 119.7 83.9 -3.6 119.5 86.8 -1.2 119.9 85.1 0.5 122.9  84.7 -2.8 124.7 88.3 -3.9 123.7      89.8 -0.9 125.5 87.2 -1.3 128.2 88.8 -4.6 129.1 92.3 -3.2 128.8 91.9 -1.8 132.3 91.6 -3.7 135.7 88.3 -5.5 136.6 86.3 -3.2 138.9      85.3 -6.1 141.2 88.7 -7.8 141.0 88.2 -11.1 139.2        87.1 -12.3 135.8        85.6 -10.1 132.9        83.1 -11.6 130.4    81.8 -10.7 126.9 78.9 -12.0 124.9        77.8 -11.6 121.3        74.2 -12.0 120.1        75.2 -13.4 116.7        78.7 -13.1 115.2    77.5 -13.8 111.7 75.7 -10.4 111.7        78.8 -8.2 112.1 80.6 -5.9 109.6 83.7 -7.5 107.9 85.8 -4.8 109.5 84.2 -5.5 112.9 85.6 -9.1 112.6      89.2 -8.1 112.3 88.8 -5.4 114.9 87.8 -8.1 117.3 90.6 -10.6 116.4        93.6 -8.6 117.7 92.2 -8.7 121.2 91.9 -12.5 121.2    95.5 -12.5 120.1 96.5 -10.2 123.0        94.2 -11.8 125.7        93.9 -9.5 128.8 94.7 -11.9 131.7        91.7 -13.9 133.1        89.1 -12.4 130.8     86.3 -14.5 129.1        84.5 -14.4 125.7        81.3 -15.9 124.4        80.5 -15.9 120.7        77.3 -17.4 119.5    76.0 -18.2 116.0 73.5 -20.3 114.2        75.8 -20.6 111.2        79.5 -20.8 112.0        80.6 -21.2 108.4        79.5 -17.8 107.3    82.1 -16.6 109.9 85.7 -15.6 109.1        87.9 -18.7 109.1        90.7 -16.8 110.8        88.2 -15.8 113.5        86.5 -19.2 114.1    90.0 -20.6 114.6 90.7 -18.5 117.7        87.6 -19.7 119.5        86.5 -23.1 120.6        83.4 -24.2 118.7        80.9 -26.1 120.8    77.9 -27.9 119.3 74.6 -27.5 121.1        73.0 -30.7 119.6        69.2 -30.8 118.8        68.0 -33.4 121.2        66.8 -36.7 119.7    63.3 -36.2 118.3 61.6 -38.6 120.7        62.8 -36.6 123.6        61.9 -33.2 122.0        58.4 -34.3 121.2        57.6 -35.6 124.7    59.0 -32.4 126.2 56.8 -30.5 123.8        53.6 -32.5 124.5        53.8 -30.9 127.9        54.2 -27.3 126.9        51.2 -27.5 124.5    48.6 -30.1 123.9 48.5 -30.9 120.2        48.7 -34.1 118.1        52.2 -35.6 118.2        52.1 -35.5 114.4        51.8 -31.8 114.5    54.3 -31.6 117.3 56.9 -33.4 115.1        56.1 -31.1 112.2        56.9 -28.0 114.3        60.2 -29.7 115.5        61.2 -30.5 111.9    60.2 -27.0 110.8 62.8 -25.7 113.3        65.7 -27.9 112.4        65.1 -29.8 115.6        65.1 -26.7 117.9        62.5 -27.5 120.5    62.4 -23.9 121.6 61.6 -22.5 118.2        59.2 -25.4 117.7        57.4 -24.4 120.9        57.2 -20.8 119.7        55.7 -22.0 116.5    52.5 -22.6 118.4 52.3 -19.7 120.9        51.0 -17.2 118.3        48.2 -18.8 116.5        50.9 -19.8 114.0        50.0 -23.4 113.8    46.4 -22.5 113.1 47.8 -20.1 110.4        49.7 -23.1 109.1        46.6 -25.3 109.0        45.0 -22.6 106.8        47.8 -23.0 104.4    47.6 -26.8 104.0 43.8 -26.5 103.4        44.3 -24.0 100.7        47.1 -26.1 99.2 44.9 -29.2 99.2 42.3 -27.4 97.2 44.7 -26.0 94.7 46.9 -29.1 94.1      44.1 -31.1 92.5 42.2 -28.1 91.1 45.1 -26.2 89.4 43.8 -22.9 90.9 47.0 -22.0 92.7 46.0 -18.4 92.8 43.6 -19.4 95.6 46.6 -19.4 98.0      46.7 -15.7 97.7 44.6 -15.2 100.8        46.6 -17.8 102.7        50.0 -16.3 101.8        49.4 -12.6 101.4        50.1 -11.5 104.9     53.0 -9.8 106.8 54.0 -13.4 107.8        54.5 -14.0 104.1        58.1 -15.2 104.4        57.5 -17.6 107.2        54.6 -18.9 105.2     56.4 -19.2 101.9        59.0 -21.3 103.7        56.2 -23.6 105.0        55.0 -24.0 101.4        58.6 -24.8 100.4    59.0 -27.6 102.9 56.0 -29.3 101.4        57.5 -28.8 97.9 60.7 -30.3 99.0 59.0 -33.4 100.5        57.0 -34.1 97.3 60.3 -33.9 95.5 62.0 -36.3 97.9      59.2 -38.8 97.5 59.9 -39.0 93.7 63.3 -40.3 94.6 61.9 -42.6 97.2 63.3 -40.7 100.2        62.2 -42.2 103.5        62.3 -39.0 105.6     59.6 -36.3 105.3        59.3 -33.1 107.2        55.6 -32.7 106.8        54.4 -35.9 108.5        51.5 -33.8 109.6    49.8 -34.3 106.2 51.3 -37.2 104.2        48.2 -37.2 102.1        49.2 -33.8 100.8        52.8 -34.5 99.9 51.5 -37.6 98.1 48.9 -36.0 95.9      51.3 -33.1 95.3 54.0 -35.5 94.1 51.3 -37.3 92.0 50.2 -34.2 90.0 53.6 -32.6 89.7 56.6 -34.0 87.9 59.9 -33.8 89.7 60.9 -31.0 87.3      57.8 -28.9 87.8 58.3 -29.2 91.5 62.0 -28.0 91.2 60.8 -25.0 89.2 58.2 -24.0 91.7 60.5 -24.7 94.7 62.8 -22.0 93.4 60.4 -19.2 92.5      58.9 -19.8 95.9 62.4 -19.6 97.2 63.7 -16.5 95.4 60.4 -14.7 95.9 60.3 -15.3 99.6 63.7 -13.7 99.7 62.8 -10.5 97.9 60.1 -10.1 100.5     62.5 -10.4 103.3        65.4 -8.5 101.8 64.0 -5.6 99.5  62.8 -2.7 101.7 59.2 -2.6 100.6 57.9 -4.3 97.4  54.2 -5.0 96.9  53.5 -8.2 98.9       50.4 -8.5 96.9  51.8 -8.1 93.4  54.8 -10.2 93.8 52.9 -13.1 95.2 50.1 -12.8 92.6 52.9 -13.0 90.1 54.5 -16.0 91.9 51.1 -17.7 91.9      50.0 -17.1 88.3 53.5 -18.0 87.3 53.3 -21.3 89.1 50.3 -22.1 87.0 52.1 -21.6 83.7 54.8 -24.0 84.7 52.0 -26.5 85.2 50.8 -26.1 81.6      52.0 -28.7 79.0 54.8 -27.5 76.7 56.2 -24.8 78.9 60.0 -24.6 79.4 60.6 -24.0 83.1 63.6 -22.0 84.5 67.2 -23.0 85.4 69.4 -21.4 88.1      71.8 -18.6 87.1 75.6 -17.8 87.3

NB. in both of these 'blocks' the equation is >4.5, so the entire line is printed. Is this your desired outcome?

What about if I want awk  code just to print the lines (1,2,3,4,5)if line 5 is less or equal 4.5?!

I have edited my answer @Amal. I don't know if it's correct or not, but if you can provide your desired output for your example input it will help determine whether or not I've understood the problem


text:
Phylogeny building in R from FASTA files:
Im working on building a phylogeny from scratch with downloaded FASTA sequences from GeneBank. I think Im doing alright up until the multi sequence alignment in the msa package where I get an error Error in convertAlnRows(result$msa, type) : There is an invalid aln file! As always thanks in advance for taking a look: Here is the reproducible example:
library (ape)
library (rentrez)
library (msa)

#Download Species Data
# B_terrestris
B_terrestris <- entrez_fetch(db = "nucleotide",
                                  id = "NC_045179.1",
                                  rettype = "fasta")

# B_hypocrita
B_hypocrita <- entrez_fetch(db = "nucleotide",
                             id = "NC_011923.1",
                             rettype = "fasta")

#Vespa
Vespa <- entrez_fetch(db = "nucleotide",
                      id = " MT137096.1",
                      rettype = "fasta")

seq<- c(B_terrestris, B_hypocrita, Vespa) # gotta clean it

#FASTA Cleaner Function
fasta_cleaner <- function(fasta_object, parse = TRUE)
{
  fasta_object <- sub("^(>)(.*?)(\\n)(.*)(\\n\\n)","\\4", fasta_object)
  fasta_object <- gsub("\n", "", fasta_object)

  if(parse == TRUE){
    fasta_object <- stringr::str_split(fasta_object,
                                       pattern = "",
                                       simplify = FALSE)
  }

  return(fasta_object[[1]])
}

#This should be ready to go!
clean.seq<-fasta_cleaner (seq, parse = FALSE)

str (clean.seq)

msa (clean.seq,  type="dna", method="Muscle", cluster="neighborjoining")

@M__ Thank you! What sequence alignment method would you reccomend instead?

The formal question I've been given is what aligner would I use? There is an issue between forming a data pipeline for ape and the latest and greatest. Its trade and the compromise would be msaClustalOmega(), but the rationale is complicated.
I strictly use muscle5 or specifically muscle -super5 option as a standalone. I am certain R msa has not introduced muscle5 and I don't even know if it's published yet. It's on bioRxiv.org. The super5 option must be specified and once done its amongst the most incredible algorithms per se notably in speed - no other aligner comes close - and personal benchmarks in accuracy. To give some idea, I was going to write an aligner as part of a package (its makes stuff simpler) and thought - whats the point with muscle5?
Its competitor was MAFFT and published benchmarks demonstrated it was the strongest, before muscle5 was released.
The dilemma is simply that ape is cool and if you are wanting to have a seamless pipeline then greatest aligners don't fit with that. MAFFT isn't in msa and seriously doubt muscle5 will be. HOWEVER Clustal Omega is in msa and that is the strongest (most recent) of the options it has. Omega does have published benchmarks and its neither quite as fast nor quite as accurate as MAFFT.
If you've got 50000 sequences - it's muscle5 no contest. If you've 50 sequences then keep the pipeline together via msaClustalOmega.

The original question and code appeared to involve converting fasta inside R onto msa. Thats how subprocessing works outside R (or Python) but it's not the OO approach.
My original answer was in comments and remains an unofficial answer because usually I run the code I'm recommending and I don't fancy subprocessing muscle via R.
The error was the msa algorithm was attempting to shift the object into a format that will subprocess via muscle and it doesn't understand fasta format (it wants the raw object). Thus, you appear to be wanting to pass "official fasta" into msa. It doesn't need it, it simply needs a sequence object. It's imported as fasta but then it should be a sequence object (it's no longer fasta). That should go straight into msa. Thus seq should load straight into msa with "fasta" option removed. Finally could you remove msa and used msaMuscle then simply msaMuscle(seq).

I tied this bit with the set of sequences  msaClustalW(c(B_terrestris, Vespa, B_hypocrita), type="dna", cluster="nj") but now I get this error: "Error in .Call2("new_XStringSet_from_CHARACTER", class(x0), elementType(x0),  :
key 69 (char 'E') not in lookup table"- Any further suggestions?

At least it can see the object. If this was Python I could debug it (well I could write the code to do it straight up), R will be more challenging. You need to print the seq object and check its integrity.  It seems to be complaining that E isn't DNA, suggesting either this is protein (unlikely) or an E from the header has got caught in the sequence. There are alternative ways to construct the sequence object, so as a last resort could do that. The idea here is to split the object attributes into sequence and ids then reassemble it.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Problem with nextflow -resume and path.fromSRA
I have a problem with  nextflow -resume
Here is my script :
Reads_ch = Channel.fromSRA(params.ids, apiKey: params.apikey)
         .flatMap { left, right ->
            def SRRCode = left
            switch(right) {
                case { right.getClass() == java.util.ArrayList && right.size() == 2 }:
                    def forward = right[0]
                    def reverse = right[1]
                    return [tuple(SRRCode.concat("_1"), forward), tuple(SRRCode.concat("_2"), reverse)]

                case { right.getClass() == java.util.ArrayList && right.size() == 3 }:
                    def forward = right[1]
                    def reverse = right[2]
                    return [tuple(SRRCode.concat("_1"), forward), tuple(SRRCode.concat("_2"), reverse)]

                case right.getClass() == nextflow.file.http.XPath:
                    def sequence = right
                    return [tuple(SRRCode, sequence)]
            }
      }

process Unzip {
    tag "Unzip $fileCode reads files using unpigz"
    maxForks params.threads
    cpus params.threads_unzip

    input:
    set fileCode, file(readsFile) from Reads_ch

    output:
    tuple fileCode, file("${fileCode}.fasta") into Kmer_ch

    script:
    """
    unpigz -cp${task.cpus} $readsFile | paste - - - - | cut -f 1,2 | sed 's/^@/>/' | tr "\\t" "\\n" > ${fileCode}.fasta
    """
}

process Kmer {
    tag "Processing $fileCode reads files using kmer-ssr"
    maxForks params.threads
    cpus params.threads_kmer

    input:
    set fileCode, file(readsFile) from Kmer_ch

    output:
    tuple fileCode, file("${fileCode}.tsv") into ComputedReads_ch

    script:
    """
    kmer-ssr -d -t ${task.cpus} -p ${params.kmerSSR.periodMin}-${params.kmerSSR.periodMax} -n ${params.kmerSSR.ssrSizeTreshold} -r ${params.kmerSSR.repeatMin} -l ${params.kmerSSR.readLengthMin} -i ${fileCode}.fasta -o ${fileCode}.tsv
    """
}

When the pipeline is broken, I try to run again with nextflow run -resume and the problem is that all sequences from SRA are downloaded again ?? and the pipeline starts again from the beginning instead of resuming the job where it was interrupted.
What is the problem, please ?
Thanks.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Using Multi-Dimensional Scaling (MDS) to produce a vector in order to account for patient bias when constructing DGE lists from RNA-seq datasets in R?
I am currently working on my PhD and as part of my thesis, I intend to analyse gene expression within multiple sclerosis (MS) lesions by looking at RNA-seq datasets on Gene Expression Omnibus (https://www.ncbi.nlm.nih.gov/geo/)  , which I have selected already. Part of my analysis is using R to transform the count matrices provided on GEO into DGElists (differential gene expression lists), and I have been using both the edgeR handbook, as well as an R script provided by one of the groups whose dataset I am including in my analysis, to construct my own code (as I have had to teach myself R programming from scratch).
[MS lesions are multiple sclerosis lesions. There are multiple subtypes that are included in this group's analysis - Active, Chronic active, inactive, remyelinating (or repairing) lesions and Normal Appearing White Matter. These classifications relate to the physiology of the lesion - active lesions are undergoing active inflammation, chronic active means it goes through periods of inflammation, inactive means inflammation isn't occurring at the moment, and remyelinating relates to a lesion that is undergoing healing.]
My current issue is as follows: Following along with the script provided by the lab group, they appear to have calculated a "PCA Vector", which they use in the creation of their design matrix. As far as I can tell, PCA, or Principal Component Analysis, is meant to account for the multi-dimensionality of a dataset, essentially transforming the data so that it can be plotted on a 2-dimensional set of axes and the variability of the points shown visually. Upon contacting the group, they said that they used PCA to find the biggest outliers as well as identify the largest patient bias, which they then normalised for.
The group has also provided their data which can be opened in R. When I utilise their "PCA vector" in the construction of my design matrix, I get the same values as the group, however, any attempts at producing this PCA vector by performing PCA using R packages does not give me values that are in any way close to those in the group's DGE lists (also provided).
My question therefore is this: Does anybody have an idea as to how one could create a "PCA vector" - a value of variation between patients - which could then be incorporated into a design matrix in order to account for patient variation? I feel I should mention - patient age, sex and MS lesion type are already accounted for as they are also used in the construction of the design matrix. Would anyone have any experience with this?
I ask that you please be gentle/patient with me - I am still very new to the world of bioinformatics (and eager to learn!) and I apologise if I have not explained my issue very well. I will do my very utmost to clear up any confusion, and I would be incredibly grateful to anyone who can help!
For those interested in seeing the journal article which includes links to the GEO repository which hosts their DGE lists and count matrix, as well as their github containing their R script and data, I have included the link below.
https://actaneurocomms.biomedcentral.com/articles/10.1186/s40478-019-0855-7#availability-of-data-and-materials

Welcome @R_Cres_01! "PCA vectors" is kind of unclear. Maybe they mean principal components (PCs)? Do you know which PC they use, and why? Normally PCA is performed on a subset of the (log-normalized) count matrix, using the top N most variable genes. So if you want to recreate their PCA embedding matrix, i.e. a cell x PC matrix where PCs are ordered by variance explained, you need to know how they transformed the data (what normalization? with or without centering and scaling?), how many genes, how they were selected. Also this may not be a good idea, see https://www.biostars.org/p/379656/

Your question title mentions MDS, (multidimensional scaling) but the question itself only mentions PCA (principal component analysis). These are similar concepts, but not the same. Can you confirm you want to do PCA adjustment (more common) rather than MDS adjustment?


text:
Which candida albicans fasta and gff file should I use for alignment?
I downloaded the gff and fasta files for candida albicans from http://www.candidagenome.org.  I want to use hisat2 to align some fastq files against it.
There are many files in each download :
gff :
A22_ForcheSNPs.gff
A22_Historic_Assemblies.gff
A22_Jones_PMID_15123810_Polymorphisms.gff
A22_Jones_PMID_15123810_Polymorphisms.vcf
A22_Unannotated_transcripts_Bruno_et_al.gff
A22_Unannotated_transcripts_Sellam_et_al.gff
A22_Unannotated_transcripts_Tuch_et_al.gff
C_albicans_SC5314_A22_current_features.gff
C_albicans_SC5314_A22_current_features.gtf
C_albicans_SC5314_A22_current_features_with_chromosome_sequences.gff.gz
C_albicans_SC5314_A22_current_intergenic.gff
C_albicans_SC5314_haplotype_variations.gff
C_albicans_SC5314_version_A22-s07-m01-r179_features.gff
C_albicans_SC5314_version_A22-s07-m01-r179_features.gtf
C_albicans_SC5314_version_A22-s07-m01-r179_features_with_chromosome_sequences.gff.gz
C_albicans_SC5314_version_A22-s07-m01-r179_intergenic.gff

fasta :
C_albicans_SC5314_A22_current_chromosomes.fasta.gz
C_albicans_SC5314_A22_current_default_coding.fasta.gz
C_albicans_SC5314_A22_current_default_genomic.fasta.gz
C_albicans_SC5314_A22_current_default_protein.fasta.gz
C_albicans_SC5314_A22_current_not_feature.fasta.gz
C_albicans_SC5314_A22_current_orf_coding.fasta.gz
C_albicans_SC5314_A22_current_orf_genomic_1000.fasta.gz
C_albicans_SC5314_A22_current_orf_genomic.fasta.gz
C_albicans_SC5314_A22_current_orf_plus_intergenic.fasta.gz
C_albicans_SC5314_A22_current_orf_trans_all.fasta.gz
C_albicans_SC5314_A22_current_other_features_genomic_1000.fasta.gz
C_albicans_SC5314_A22_current_other_features_genomic.fasta.gz
C_albicans_SC5314_A22_current_other_features_no_introns.fasta.gz
C_albicans_SC5314_A22_current_other_features_plus_intergenic.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_chromosomes.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_default_coding.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_default_genomic.fasta
C_albicans_SC5314_version_A22-s07-m01-r179_default_protein.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_not_feature.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_orf_coding.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_orf_genomic_1000.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_orf_genomic.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_orf_plus_intergenic.fasta
C_albicans_SC5314_version_A22-s07-m01-r179_orf_trans_all.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_other_features_genomic_1000.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_other_features_genomic.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_other_features_no_introns.fasta.gz
C_albicans_SC5314_version_A22-s07-m01-r179_other_features_plus_intergenic.fasta.gz

I'm pretty sure I'd like to use the version *A22-s07-m01-r179* since it seems like it is a version that will is not transient like the *current* files.
QUESTION :
I am looking at bulk gene expression derived from an RNA-Seq experiment run on an Illumina sequencer.  Which gff / fasta file should I use for alignment with hisat?

What kind of sequencing did you do? Targeted? A gene panel? An exome? WGS?

Just gene expression using rna-seq on an Illumina sequencer.  Grinding up cells and getting the bulk gene expression

OK, please add that to your question, but make sure to actually explain what you are looking at. The file you need will be different if you're looking at all genes or specific genes. You can always use the main file with all chromosomes, but if you know you only care about 5 genes and all or on chr2, there is no point in using the whole thing.

First of all, you almost certainly want the current files. The convention in pretty much all sequence repositories is that foo.current is always the link pointing to the most recent and most up to date data. Those are what you want and not some "stable" version, you want the most accurate and that will usually be the current. In any case, my bet is that you will find that the *A22-s07-m01-r179* files are exactly the same as the corresponding *current* files since the current ones will just be symlinks.
Next, in order to align your data, you need the genome. The genome is this one:
C_albicans_SC5314_A22_current_chromosomes.fasta.gz
That is the file that has the chromosomes in fasta format, so that's the one you want for alignment. Now, if you have done RNAseq and only care about annotated, known genes, you could speed things up a little by using one of the more targeted files (just scroll down on the page you linked to for an explanation of what each file has), but using the whole genome won't be wrong. And at 8.4M compressed, that's a tiny genome so I don't think it's worth trying to get much more speed out of what will already be a pretty quick process.
As for which GFF, that will again depend on what you want, but most likely you want either of these, depending on whether you want GFF or GTF:
C_albicans_SC5314_A22_current_features.gff
C_albicans_SC5314_A22_current_features.gtf

The main message is that you usually want the "current" files, just make a note of what version the "current" files are pointing to if you need to report that.

The refseq is Candida albicans SC5314.
I assume you are performing a fasta reference based assembly.
Its 8 chromosomes are  NC_032089.1 to NC_032096.1 inclusively from chromosome 1 to chromosome 7 (NC_032095.1) to chromosome R.
Its here.
Most of the files you downloaded are SC5314. So I dunno it depends what the project is re-annotation, reassembly?
The vcf is a very interesting file, particularly if you are sequencing your own variants of Candida.
Whats in all the files:

C_albicans_SC5314_A22_current_orf_coding.fasta.gz proteins ignoring introns - useful
C_albicans_SC5314_A22_current_chromosomes.fasta.gz is going to be NCBI files I described.
C_albicans_SC5314_A22_current_default_protein.fasta.gz orfs splicing out the introns

... list goes on really it depends on the project. I would recommend current only. A22-s07-m01-r179 will likely be the previous assembly / annotation.
I guess the single file you want is C_albicans_SC5314_A22_current_chromosomes.fasta.gz for referenced based assemblies (presumably of Candida isolates).


text:
Automate the def function in pandas for correlation
def correlations(group):
    # Remove columns
    group = (
        group.reset_index()
        .drop(columns=["RNA1_Approved_Symbol"], level=0)
        .set_index("RNA1_ID")
    )
    # compute correlations
    correlation = group.T.corr()

    # rename pair column
    correlation = correlation.reset_index().rename(
        columns={"RNA1_ID": "RNA1_ID_new"}
    )

    # Remove NAs
    corr_result = (
        correlation.melt(value_name="Correlation", id_vars=["RNA1_ID_new"])
        .set_index(["RNA1_ID", "RNA1_ID_new"])
        .dropna()
    )
    return corr_result

def correlation_1(data):
    ## Create Pivot table
    pivot_library = data.pivot(
        index=["RNA1_Approved_Symbol", "RNA1_ID"], columns=["RNA2_ID"]
    )

    # Measure correlations between four id's
    return (
        pivot_library.groupby("RNA1_Approved_Symbol")
        .apply(correlations)
        .reset_index()
        .dropna()
    )

I am using the above function to calculate the correlation
data = df1
correlations = correlation_1(df1)

I want to automate the above function when I am using different data frame where there is RNA2_Approved_Symbol instead of RNA1_Approved_Symbol and RNA2_ID instead of RNA1_ID. Like using index 1 and index 2.

Hi @Riya, pretty sure I could solve this. Could you supply a test data set for your new dataframe please? Actually, I think I get the question and there's no need of a dataset. Hope to have a response end of week.

If I have understood the question is to generalise the column names to permit a function to accept dataframes where you don't have the same column name, or it's different from the previous dataframe column names. Here the column could be called RNA1_Approved_Symbol or RNA2_Approved_Symbol in addition a different column could be called RNA2_ID or RNA_ID. No problem providing the column order is identical for the columns in question. If the orders are not identical see the code below the ---- to correct that.
If the order is identical the simple answer is df.columns[i]. Thus it's obtaining the column name on its position within the dataframe (columns command), where i is the column location.
Example, to rename RNA1_ID to RNA1_ID_new, or RNA2_ID to RNA2_ID_new
import re

df1 = pd.DataFrame({"perch": [5,6,7], "RNA1_ID": [1,2,4], "roach": [30,42,51]})
df2 = pd.DataFrame({"perch": [5,6,7], "RNA2_ID": [1,2,4], "roach": [30,42,51]})

def renamecolumn(df):
    myname = df.columns[1]
    newname = re.sub(r'$','_new', myname)
    df = df.rename(columns={myname: newname})
    return df

print (renamecolumn(df1))
print (renamecolumn(df2))

Output,

-
perch
RNA1_ID_new
roach

0
5
1
30

1
6
2
42

2
7
4
51

-
perch
RNA2_ID_new
roach

0
5
1
30

1
6
2
42

2
7
4
51

I noted there was a fair number of set_index commands so the earlier the column name can be trapped inside a variable the better, because set_index will change the column order.

Alternatively, the columns can be re-arranged to be in a given order if the original order between df1 and df2 is different. Here I'll move the column to the front.
mycols = df1.columns.tolist()
mycols = mycols[-2:] + mycols[:-2]
df1 = df1[mycols]
print (df1)

-
RNA1_ID
roach
perch

0
1
30
5

1
2
42
6

2
4
51
7

Thus RNA1_ID has been moved from the second to the first column. If df2 was in the last column repeat as above use -1 instead of -2 and both columns will now be at the start of the dataframe. Modify the core dataframe generalisation renaming accordingly, viz.
myname = df.columns[0]

... sorted.


text:
Why is COI metabarcoding not used for prokaryotes?
I'm a beginner in bioinformatics working with environmental metabarcoding, and while reading up on different marker genes, I understand that COI is preferably used for animals thanks to its higher variability over 18S (although it depends on which taxonomic resolution fits best and which reference data is available). What I don't understand though, and can't find an answer to, is why COI metabarcoding isn't used for bacteria and archaea as well. Why is 16S preferred, although bacteria and archaea clearly have the COI gene? Is it not variable enough? Or are the primer binding sites too variable? Something else?

Hi @Joel welcome to the site. This is a reasonable question and I'm happy to answer it, however could you state the taxonomic groups in your study?

The exact answer to your question is bacteria do not have a mitochondrion, therefore cox1 is not a universal gene combining both Archaebacteria and bacteria. In contrast 16S is universal for these two kingdoms AND it is also single copy. Moreover, bacteria have diverse tropisms beyond the Krebs or Calvin cycles. Extensive studies have been performed on 16S and it provides an excellent taxonomic target in bacteria.
18S is a problematic target in eukaryotes because it can paralogous and that is not an ideal target in taxonomic studies, but has nicely conserved primer site: thus single copy genes are required/preferred. In addition, 18S is prone to indels (insertions/deletions) and these are difficult to model, align and understand the underlying molecular mechanism or selection advantage.
Every animal on earth has a mitochondrion and therefore cox1. Mitochondrion genes are guaranteed to be single copy in higher eukaryotes and cox1 has been extensively sequenced throughout metazoans. Thereby barcoding is appropriate because there's an exact reference to identify a given species is usually available. It has been extremely successful in insects which are the most biodiverse and species rich taxonomic Class on earth: there are more insects than all other higher eukaryotic species combined.

In answer to the comments ...

Whether mitochondrion were originally bacteria is a very difficult question and remains a theory (compartmentalisation theory - very old). I have not seen any rigorous phylogenetic support for this.

cox1 (COI) or cox2 (COI) is not universal to bacteria, e.g. here. Its primary use is for aerobic organisms (oxygen consuming). Thus cox1 has a strong Krebs cycle association but there are a multitude of anaerobic pathways.

Anaerobic bacteria don't necessarily need cox1/cox2 and there are a lot of obligate anaerobic bacteria in addition to non-obligatory anaerobic bacteria (which can do both).
Marine metazoan are obligate aerobic organisms.

There is no reason to suppose bacteria  are strictly  single copy cox1. mtDNA is tiny and hence copy number heavily constrained, bacterial genomes by contrast are much larger and could easily accommodate duplication events.

There isn't much work on bacterial cox1, it has been pursued to attempt to augment antibiotic therapy. Degli Esposti (2020) is the closest I know to a comprehensive discussion on the bacterial cox genes.

Thanks for your answer. A few questions:
• I know prokaryotes don't have mitochondria, but that shouldn't make a difference since mitochondria are descendants of bacteria, right? As far as I understand, both eukaryotes, bacteria and archaea have the COI gene.
• What do you mean by "diverse tropisms beyond the Krebs or Calvin cycles" and how does it matter?
• I had not considered paralogy, but now that you bring it up I understand that it must be problematic to have different variants of the same marker gene in the same individual. But do paralogues of COI really exist in bacteria/archaea?

I'm primarily interested in marine metazoan diversity, so COI is what I'm being told to use. But I just fancied what a lovely story it would be if those universal COI primers could be designed to work on prokaryotes as well, and then it got me trying to find out why not. If you know any paper that discusses this, I'd be happy for it!

@Joel addressed in comments.

Thank you @M__. You bring back parts of my biology education that I'd forgotten, and now it all makes sense. If I'll do prokaryotic metabarcoding, I can now rest assured that 16S is the correct choice. But I still hope for someone to find a universal marker gene that does work for eukaryotes and prokaryotes alike :)


text:
GLM for multinomial using r - results of genotyping
I have next data:

age - how old is person, e.g. 17 or 25
bmi - body mass index,  e.g. 18.25 or 29.35
rsXXX - results of genotyping in rs(point), e.g. rs10852521: C/C, C/T and T/T

I devide all data in 2 groups bmi_group, create new column bmi_group, remove all rows not in group

low - bmi<25.0
high - bmi>=30.0

LG = 25.0
HG = 30.0
subdata = subset(all_data, bmi < LG | bmi >= HG)
subdata$bmi_group <- with(subdata, ifelse(bmi < LG, 'low', 'high'))

I need to find out if a certain allelic variant affects the risk of obesity, taking into account age. I try next:
> model <- glm(imt_group ~ rs11075990+age, data = point.data, family = binomial)
> summary(model)

Deviance Residuals:
    Min       1Q   Median       3Q      Max
-2.4209  -0.6968   0.4239   0.6470   2.0662

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept)    6.07127    0.56333  10.778   <2e-16 ***
rs11075990A/G -0.65093    0.28982  -2.246   0.0247 *
rs11075990G/G -0.53818    0.35860  -1.501   0.1334
age           -0.12783    0.01235 -10.351   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 568.58  on 430  degrees of freedom
Residual deviance: 403.53  on 427  degrees of freedom
AIC: 411.53

Number of Fisher Scoring iterations: 4

Problem is genotyping data not binominal - Factor w/ 3 levels "A/A","A/G","G/G":. What and how can I do?

I do not see a problem here. There are 3 levels corresponding to the three genotypes and genotype A/A is the base (reference) level and the "effects" of the other two genotypes are stated "on top of the base level".
This tutorial on linear regression with factor levels is very useful to understand how to conduct linear regression in general but also goes over the specifics of doing so with R.
Moreover, you created a new discrete (factor) variable out of a continuous variable when you bin BMI status as low or high. You can certainly do so but you can also use it as it is, as a continuous variable. And I guess you forgot to include this variable in your model.

Note also that you can set the reference level with relevel(subdata$rs11075990, ref = "G/G").


text:
Normalization and Merging of Gene Expression Panels with Overlapping Genes from Same Cohort
I have done some gene expression work using two Nanostring panels (glial profiling and neuroinflammation) on the same 18 tissue samples. There are some overlapping genes between the panels, about 150 of 1400. Does anyone have any suggestions, possibly using a R package but open to other software, for how to normalize the gene expression data (raw count data) and deal with the overlapping genes between the two panels from the same samples. I have found some normalization packages (RUVSeq) for R but not yet something to handle the overlapping genes.
Thank you,
Carolyn

What is the point to normalize them together? There is a batch effect between both due to different panels which cannot meaningfully be corrected due to the small overlap of genes. Why not analyzing separately using the control genes the panels have as reference, for example with DEseq2.

Nanostring already provides their own normalisation software for adjusting gene counts based on panel and general controls (which is pretty good). Is there a particular reason why you're not using that?


text:
Why do XRAY (but not CryoEM) structures of ribosome in PDB have 2 assemblies?
When i started programming against PDB i had a mixture of confusion & frustration with the fact that certain cif files contain two actual structures aka assemblies of the object; i take it for granted now.
However, i observe now (from years of usage) that in the case of the ribosome XRAY/NMR structs frequently have exactly 2 structures aka assemblies stuck together with very little differnce between those two assemblies (~2-3 atom difference in a ~150,000 atom structure). Is there a reason for that? Does it have to do with the way microscopy is done or is it just the artifact of the deposition process? Why not deposit them as separate structures or just one if they are near nigh identical?
Example is 4V5D with 2 assemblies: Assemblies data.
PS.
The relevant gql snippet for rcsb data api:
{
  entry(entry_id:"4v5d"){
    assemblies{
      rcsb_assembly_info {
        assembly_id
        atom_count
        branched_atom_count
        branched_entity_count
        branched_entity_instance_count
        hydrogen_atom_count
        modeled_polymer_monomer_count
        na_polymer_entity_types
        nonpolymer_atom_count
        nonpolymer_entity_count
        nonpolymer_entity_instance_count
        num_heterologous_interface_entities
        num_heteromeric_interface_entities
        num_homomeric_interface_entities
        num_interface_entities
        num_interfaces
        num_isologous_interface_entities
        num_na_interface_entities
        num_prot_na_interface_entities
        num_protein_interface_entities
        polymer_atom_count
        polymer_composition
        polymer_entity_count
        polymer_entity_count_DNA
        polymer_entity_count_RNA
        polymer_entity_count_nucleic_acid
        polymer_entity_count_nucleic_acid_hybrid
        polymer_entity_count_protein
        polymer_entity_instance_count
        polymer_entity_instance_count_DNA
        polymer_entity_instance_count_RNA
        polymer_entity_instance_count_nucleic_acid
        polymer_entity_instance_count_nucleic_acid_hybrid
        polymer_entity_instance_count_protein
        polymer_monomer_count
        selected_polymer_entity_types
        solvent_atom_count
        solvent_entity_count
        solvent_entity_instance_count
        total_assembly_buried_surface_area
        total_number_interface_residues
        unmodeled_polymer_monomer_count
      }
    }
  }
}

..... Refinement was conducted using CNS first through a rigid body refinement of each of the two 70S molecules in the asymmetric unit; an additional rigid body refinement where each domain of the ribosome, the tRNAs and ribosomal proteins were defined as separate rigid-body groups, followed by two rounds of energy minimization and B-factor refinement. .... https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2679717/

PS your graphql link returns an error

@pippo1980 i see, that's how they processed it. Still begs the question why they refine two molecules together and why they deposit it together. Basically every xray structure of the ribosome in PDB is like that... Is it just that it's infeasible to separate them before the X-ray..?

I remember about xray, dont know much about cryoEM but: The content of the asymmetric unit depends on the crystallized molecule's position(s) and its conformations within the unit cell. Depending on the crystallization conditions and local packing two distinct scenarios may occur: Copies of the macromolecule or complex within a crystal unit cell have identical conformations and occupy symmetry-related positions.

As a result, the biological assembly may either be composed of one copy of the macromolecule/complex or it may be composed of two or more symmetry related molecules/complexes coming together to form a larger assembly.
Copies of the macromolecule or complex take on slightly different conformations and occupy unique positions in the crystal asymmetric unit. As a result, each of the different positions of the macromolecule/complex may correspond to structurally similar but not identical biological assemblies.

see https://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/biological-assemblies , I believe nowadays all the molecules present into the AU are shipped in the cif

interesting too https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4157440/ Molecular replacement with a large number of molecules in the asymmetric unit

Thanks for carrying on the conversation, @pippo1980. I hope we are not talking past each other, but i get the AU and it's flexible relationship to the assembly. My question in the pdb lingo, i guess, is mostly along the lines of "why is it that every XRAY ribosome is an assymetric unit with multiple biological assemblies" i.e. case 3 in the pdb101 article u link. Why not 1000s like nmr (disk-space notwithstanding) or varying numbers of assemblies(some 2, some 14, some 1, some X..) between depositions? It is always two assemblies. Leads me to think it's experimental.

NMR is another world, molecule in solution moves so thats why you get all the conformation you can see in the different models, didnt know the reach the ability to get ribosome assemblies by NMR. Still cant get your question, hope somebody else could jump in, maybe I am missing something

Thanks a lot anyway!


text:
Getting nearest gene from SNP data using SNP ID, CHR, and BP
I have data from a GWAS that provides me with the SNP, Chromosome, and base-pair. My data set has thousands of SNPs. What is the easiest way to find the nearest gene for each SNP using this information? My data looks like this:

What language are you using? There are some approaches listed here: https://www.biostars.org/p/111225/ , do any of those answers suit?

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Do you want the nearest gene or the gene(s) that overlap the position? What if the nearest gene is a few megabases away, would you still want that?

This answer assumes that you have a terminal that runs linux commands and python, and that you can install and run bedtools.
step 1: convert your input spreadsheet to BED format.
There is probably an awk one liner that does this but something like this python script will do it based on csv input (assuming that your coordinates are 1-indexed):
# writes BED format to standard output, capture it in input_file.bed
# not actually run
with open("input_file.csv") as infile:
  for line in infile:
    fields = line.split(",")
    coord = int(fields[2])
    outline = f"chr{fields[0]}\t{coord - 1}\t{coord}\t{fields[1]}"
    print(outline)

step 2:
sort the BED.
sort -k1,1 -k2,2n input_file.bed > input_file.sorted.bed

step 3:
Get genome annotations. I am assuming that you are using the grch38 build of the human genome.
wget https://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_43/gencode.v43.annotation.gff3.gz

step 4:
Get nearest gene for each snp.
bedtools closest -a input_file.sorted.bed -b gencode.v43.annotation.gff3.gz > input_annotated_with_genes.bed


text:
How to investigate the correlation between transcript and protein abundance?
Our study shows that gene A knockout will down-regulate cell cycle-related genes in some cell lines. My aim is to understand whether cell cycle-related genes are down regulated on the transcriptional or translational level upon gene A knockout.
I plan to compare the transcript and protein abundance of cell cycle-related genes between two groups of cell lines (1st group: sensitive to gene A knockout; 2nd group: not sensitive to the knockout). May I ask how can I do this? Are there any tools, databases and papers related to my goal? Thank you very much!

This sounds more like a wet-lab question than a bioinformatics one. You are basically asking about how to run quantitative PCR or simlar techniques to measure transcript abundance and whatever would be used (sorry, no idea) to measure protein abundance, right? Once you have your data, we can help process them, but we can't help on the experimental side.

There are a large number of issues with this question. The first issue with the question is we don't know what organism is being studied, I might guess at yeast (traditional cycle model) - but that would be weird because there's loads of studies like that on yeast. It is very unlikely to be yeast because the RNA vs protein will be understood in detail. The second is what knock-down is it? ... and so on. Then there is the unfocused issue of the question about a comparison between transcriptomics vs. proteomics and how to analyse the relationship between them.

To simply answer the question, papers - yeast. Method of comparison supervised machine learning.


text:
Determine expression values for a defined list of genes across different clusters in scRNA data using seurat
I am analyzing publically available scRNA seq datasets on R using Seurat. I have created a seurat object, clustered and annotated different cell types. Now, I am interested in comparing the expression values and percentage of expressing cells within each cluster for a given set of genes I am interested in. I can  visualize their expression using DotPlots, feature plots, etc... but how can I generate a table with the expression values (log2FC) for my defined set of genes across the different clusters/cell types?
Thanks!

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Please clarify more precisely what you want, as there is inconsistency in your question. log2FC values are log-transformed fold change values, and represent a change between two expression profiles, i.e. they represent differential expression, not expression.

Assuming you're looking for differential expression values, the FindMarkers function within Seurat would be a good thing to try first:
# find all markers distinguishing cluster 5 from clusters 0 and 3
cluster5.markers <- FindMarkers(pbmc, ident.1 = 5, ident.2 = c(0, 3), min.pct = 0.25)
head(cluster5.markers, n = 5)
##                       p_val avg_log2FC pct.1 pct.2     p_val_adj
## FCGR3A        8.246578e-205   4.261495 0.975 0.040 1.130936e-200
## IFITM3        1.677613e-195   3.879339 0.975 0.049 2.300678e-191
## CFD           2.401156e-193   3.405492 0.938 0.038 3.292945e-189
## CD68          2.900384e-191   3.020484 0.926 0.035 3.977587e-187
## RP11-290F20.3 2.513244e-186   2.720057 0.840 0.017 3.446663e-182

[Note the avg_log2FC column]
More details can be found at the bottom of the Seurat tutorial pages for the PBMC 3K Guided Tutorial, Finding differentially expressed features (cluster biomarkers):
https://satijalab.org/seurat/articles/pbmc3k_tutorial.html

Thanks you very much! Yes, that is what I was looking for. I also found the AverageExpression function to look at expression values across clusters


text:
Barrnap Bacterial rRNA Predictor script permission denied error when running Prokka
I am trying to run the Prokka annotation tool on my linux machine and have installed Barrnap and added it to $PATH and given the folder chmod 777 permission. However, when running Prokka, it gives the line Could not parse version from 'sh: 1: barrnap: Permission denied'.
Running Barrnap solely through the command line with a valid input works fine but does not seem to work when another script calls barrnap. I have tried checking path variables and giving max permissions to barrnap and Prokka but it does not seem to change this error. Here is the full log file:
[15:01:28] This is prokka 1.14.6
[15:01:28] Written by Torsten Seemann <torsten.seemann@gmail.com>
[15:01:28] Homepage is https://github.com/tseemann/prokka
[15:01:28] Local time is Thu Feb 23 15:01:28 2023
[15:01:28] You are saurab
[15:01:28] Operating system is linux
[15:01:28] You have BioPerl 1.7.8
[15:01:28] System has 16 cores.
[15:01:28] Will use maximum of 8 cores.
[15:01:28] Annotating as >>> Bacteria <<<
[15:01:28] Generating locus_tag from 'jobs/NC_004556.faa' contents.
[15:01:28] Setting --locustag ECJHPMJE from MD5 ec31963ed5d3d76e28501fa7e45ca273
[15:01:28] Creating new output folder: PROKKA_02232023
[15:01:28] Running: mkdir -p PROKKA_02232023
[15:01:28] Using filename prefix: PROKKA_02232023.XXX
[15:01:28] Setting HMMER_NCPU=1
[15:01:28] Writing log to: PROKKA_02232023/PROKKA_02232023.log
[15:01:28] Command: /home/saurab/BIOIN/basys2-app/sub_programs/prokka/bin/prokka jobs/NC_004556.faa
[15:01:28] Appending to PATH: /home/saurab/BIOIN/basys2-app/sub_programs/prokka/bin/../binaries/linux
[15:01:28] Appending to PATH: /home/saurab/BIOIN/basys2-app/sub_programs/prokka/bin/../binaries/linux/../common
[15:01:28] Appending to PATH: /home/saurab/BIOIN/basys2-app/sub_programs/prokka/bin
[15:01:28] Looking for 'aragorn' - found /home/saurab/BIOIN/phastest-app/sub_programs/aragorn
[15:01:28] Determined aragorn version is 001002 from 'ARAGORN v1.2   Dean Laslett'
[15:01:28] Looking for 'barrnap' - found /home/saurab/BIOIN/phastest-app/sub_programs/barrnap
[15:01:28] Coult not parse version from 'sh: 1: barrnap: Permission denied'

Please [edit] your question and add the output of ls -l /home/saurab/BIOIN/phastest-app/sub_programs/barrnap. You say you set the directory to 777 but what about the actual script/executable?

My suggestion is to run prokka from within conda by simply downloading miniconda then
conda create --name prokka
conda activate prokka
conda install -c conda-forge -c bioconda -c defaults prokka
prokka --help
prokka --version
prokka mycontigs.fa # running prokka

You could always perform a
chmod 700 /home/saurab/BIOIN/phastest-app/sub_programs/barrnap

or some variant like chmod 500 ...
or possibly using a recursive chmod -R 500 that sort of thing. Eventually it will work.
However, it strikes me you are installing prokka outside any virtual environment such as conda or brew and I would not do that personally, because you are giving significant permissions to the algorithm.
conda (or brew) will sort out all the permission needed and there's no need to do anything with chmod stuff.
Good luck with the annotation.


text:
Is there a graphical/interactive 16S rRNA clustering method?
I've been doing phylogenetics with large (hundreds) 16S rRNA sequences lately.
Usually I'm focusing on one order, and using a combination of trees and sequence similarity to assess stuff like 'is this a genus', 'is this a separate genus', 'is this sequence actually in the order of interest'. It feels like a lot of what I do is repetitive and could be automated more. In particular, it feels like there should be a simpler way for having an assemble view at sequence similarity rather that calculating a Percentage Identity Matrix and then putting it in Excel with conditional formatting. I'm imagining something like this clustering diagram for species (https://www.researchgate.net/publication/360738216/figure/fig4/AS:1182363421806594@1658908815491/The-t-SNE-clustering-of-bacterial-genomes-in-the-code-RA-space-at-different-taxonomic.png), but for sequences instead (using sequence similarity values, at least). Still, I can't seem to find something like that for 16S rRNA that's as visually compelling (or even as visually helpful as my Excel sheet). There are a number of programs for clustering OTUs, but the ones I've encountered don't seem to have a graphical / interactive interface.
Does something like this exist? Thank you for your time!

My recommendation is MegaX. It's the closest thing in phylogenetics to an all encompassing GUI.

This has a nice visual alignment editor which highlights conserved, variable and parsimonious sites.
It will produce distance matrices based on any number of criteria, e.g. % homology, Jukes-Cantor, Kimura-2 parameter etc ...
Good for bootstrapping distance-calculations as well as can perform ML based tree building methods with full parameterisation.
Nice tree visualisation, which can be edited, switched to viewing bootstrapping (if performed), or to branch genetic distances (again under any distance criteria, e.g. %age homology etc ..). It does loads of other stuff, which in this case are not needed.

You can export the tree and import into FigTree to produce collapsed clades represented by coloured triangles. In summary for easy GUI stuff MegaX, then FigTree.
There are no PCA/MDA based analysis for 16S sequence data because eiganvalue-based calculations would override lots of theory involved in point mutation modelling and the resulting trees. I could replicated the PCA output in the question with sequence data, its not hard to do - but it's not publishable.

Thank you. I'm not sure I understand the last part. (I'm not really familiar with PCA/MDA/eigenvalue) Is it difficult for some reason to represent sequences as blobs, with distances between them based on sequence similarity values? (and potentially different colors based on tresholds)? I don't think that sequence similarity alone is a good idea, but it has provided helpful supporting data to trees in the past (e.g. 'yes, these genera are likely closely related even though support values are abysmal' or 'no, there is no support for these genera being closely related, this is probably LBA')

@Laura, the 'difficulty' is the diagrams you showed were a PCA analysis (axis were 1+2 components). The problem is not the practicality but the theoretical model of what a 'blob diagram' represents. The theory you are using is modelling point mutation, Jukes-Cantor correction and all that. You can't replace Jukes-Cantor with PCA - completely different.  Also you can't do PCA on a distance matrix because there's no multivariates. Sure, I could code a 'blob diagram' but the theory used would be controversial - thats the problem.

Converting a distance matrix to a 'blob' diagram - it's better to use clustering analysis, i.e. make a tree. Clustering algorithms (you normally use Neighbor-joining but it's one amongst many) are the best approach to analysis of a distance matrix. LBA + support ... if could put that as another question might be able to help.

We can chat briefly here https://chat.stackexchange.com/rooms/58858/bioinformatics but I will simply explain that the model used isn't applicable to blob diagrams

Thank you. Sorry. I lack the vocabulary. I guess I wasn't really aiming for a PCA, just a graph where I could show that different points (in my case, sequences) are similar by how close they are together. Sort of, sequence A and B and C would be close together due to high similarity values (~97%), and D would be a bit off to the side (but closer to C than A or B). I'm not sure if this makes sense. I'm also confused as to how sequence similarity values necessarily imply an evolutionary model or evolutionary distance (blastn has a scoring matrix of +1match/-3gap, but does that imply J-C? @M__♦


text:
Math on Pandas Columns
I have a pandas dataframe that reads in a PAF file from minimap2. What I would like to do is take the first 5 columns of the data from to create a BED file.
I used this to extract the first 5 columns:
import pandas as pd
import numpy as np
df=pd.read_csv(tag1_paf, delimiter = "\t")
#print(df[4])

specific_columns=df.iloc[:,[0,1,2,3,4]]
print(specific_columns)

Which outputs this:
read1  47215  20591  21087 +
read2  14111  3478   3973  +
read3  30861  21367  21855 +
read4  4647   767    1257  -
read5  11706  9569   9990  +

But now I want to do math on the third and fourth columns depending on the strand its on. For example, if column 5 = "+" add 1000 to the third column.
I can't figure it out on my own - I've tried looking it up and using the series add/sub methods from pandas (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.add.html) but I'm still confused.
If anyone can help that would be very appreciated!

The vectorised solution (fast) is,
import pandas as pd
filepath = '/pathtodir/test/bioinfo.csv'

df = pd.read_csv(filepath, delimiter=" ", header=None)

df.loc[df[4] == "+", 'new2'] = df[2] + 1000
df.loc[df[4] == "-", 'new2'] = df[2]
df = df.drop([2], axis=1)
df = df[[0,1,'new2',3,4]]
print (df)

-
0
1
new2
3
4

0
read1
47215
21591.0
21087
+

1
read2
14111
4478.0
3973
+

2
read3
30861
22367.0
21855
+

3
read4
4647
767.0
1257
-

4
read5
11706
10569.0
9990
+

An alternative method to re-order the columns then the answer is Automate the def function in pandas for correlation
Original data

0
1
2
3
4

0
read1
47215
20591
21087
+

1
read2
14111
3478
3973
+

2
read3
30861
21367
21855
+

3
read4
4647
767
1257
-

4
read5
11706
9569
9990
+

Final solution
df = pd.read_csv(filepath, delimiter=" ", header=None)
df.loc[df[4] == "+", 'new2'] = df[2] + 1000
df.loc[df[4] == "-", 'new2'] = df[2] - 1000
df.loc[df['new2'] < 0, 'new2'] = 1
df = df.drop([2], axis=1)
df = df[[0,1,'new2',3,4]]
print (df)

-
0
1
new2
3
4

0
read1
47215
21591.0
21087
+

1
read2
14111
4478.0
3973
+

2
read3
30861
22367.0
21855
+

3
read4
4647
1.0
1257
-

4
read5
11706
10569.0
9990
+

... worked too

Thank you so much! That's exactly what I was looking for. Quick follow up question -  I was able to add in parameters where if df[4] = "-" then subtract 1000 from df[2] but if there is an instance where the value becomes negative I would just like to make it equal 1. Is there a quick way to add that into this as well? I don't wanna mess around with if statements if it's going to yell at me for formatting

@rimo modified above below the ----. Any value that is negative will be changed to 1

The -1000 is now included.


text:
To find amino acid substitution from fasta alignment
I have fasta multiple sequence alignment file of protein sequence. I want to look for mutation/substitution in amino acid between query with reference to one query. Is there any R package or any method I can go through.

why a perl tag to your question ?

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

User-friendly alternative:
Get the alignment into Jalview, set a colour scheme you like, and inspect alignment visually. You can move sequences up and down in the alignment with keyboard arrows, so you can focus on what you need.
Online, no-install-needed alternative:
(same program as M_'s method)
blastn on NCBI website. Tick 'align two or more sequences'. Query in the top box, all the others in the bottom box.
(Would not use this method if you had> 20 seqences).
If you have many sequences, I reccomend going with M_ 's advice instead.

Or use Seqotron same thing, but might be restricted to Mac OSX

Use local Blast
makeblastdb -in myproteins.fa -parse_seqids -blastdb_version 5  -out myfasta.db -title "protein db" -dbtype protein

blastn -query reference.fas -db myfasta.db -evalue 1e-6 -num_threads 4 -out blasthits.txt

-db made from the fasta alignment file (preferably without gaps)
-query is the sequence your reference sequence
Output there will be a pairwise comparison for every sequence against your reference.