data conversion – python script to convert nucleotide sequence in table to fasta format

I have performed ancestral sequence reconstructions to determine the nucleotide sequence for each node of a given phylogenetic tree. The output file is a table with the most probable nucleotide at each position for each node (see below):

#output file:
node_name, position, nucleotide
node1, 1, A
node1, 2, T
node1, 3, G
....
node2, 1, A
node2, 2, T
node2, 3, G
...

I would like to convert this output file into a fasta file, like this:

>node1
ATG....
>node2
ATG....
.....

How can I do this task with a python function, with R, or with a shell script (with awk and sed commands)?

Best regards,

Gabriel

macbook pro – Should I format my disk when reinstalling macOS?

I’m having some issues with my 16 inch MacBook Pro. It restarts and gives me the “Your computer was restarted because of a problem.” prompt. It has done that 5 or 6 times so far. I was advised to do a recovery.

Apparently, you can reinstall macOS without wiping the disk. You can also reinstall and wipe as well. And if you go even further, you can reinstall and start from scratch without any data or apps.

Is it preferable to go all the way and start from the beginning, like how it was on the day it shipped?

c# – How to properly format classes for JSON deserialization with JSON.net for Unity?

I am creating an inventory system and decided to keep a master list of all the items. The goal is to use JSON.net to parse the item list and populate the database of items. The JSON item list looks like:

{
    "Items":{
        "Ingredients":{

        },
        "Consumables": {
            "0" : {
                "ID" : "TP_Small",
                "Icon" : "Sprites/porridge.png",
                "Name" : "Small Tan Pill's Porridge",
                "Consumable" : true,
                "Cooldown": 0,
                "Duration": 3,
                "Effect Description" : "Restores 100 health.",
                "Description" : "A hearty drinkable meal from everyone's favorite hypercellulose gelatin timelord!!!",
                "SFX": "{eb4e9ad8-c6ac-414f-8d5e-c3d012ca6ae6}",
                "Bonuses" : {
                    "HP": 100,
                    "Stamina": 100,
                    "Tolerance": 20,
                    "Attack": 4
                    }

                }
        },
        "Concoctions":{

        },
        "Equipment": {

        },
        "Abilities" : {

        }   
    }
}

And this is the structure of the classes we are using to match the JSON:

(System.Serializable)
    public class Items
    {
        public List<ItemCategory> type { get; set; }
    }

    (System.Serializable)
    public class ItemCategory
    {
        public List<ItemBase> id { get; set; }
    }

    (System.Serializable)
    public class ItemBase
    {
        string ID { get; set; }
        string Icon { get; set; }
        string Name { get; set; }
        bool Consumable { get; set; }
        int Cooldown { get; set; }
        int Duration { get; set; }
        string EffectDescription { get; set; }
        string Description { get; set; }
        string SFX { get; set; }
        StatBonus Bonuses { get; set; }
    }

    (System.Serializable)
    public class StatBonus
    {
        int HP { get; set; }
        int Stamina { get; set; }
        int Tolerance { get; set; }
        int Attack { get; set; }
    }

However, when I use the debugger, it seems everything but the root class is null and the root class’s value is the “InventoryItems+items”, with InventoryItems being the name of the file.

How can I access an item by it’s number in the list? So items -> Consumables -> 0 and that element’s fields

The deserialization code:

TextAsset json = Resources.Load<TextAsset>("itemList");

        itemList = new Items();

        itemList = JsonConvert.DeserializeObject<Items>(json.text);

        Debug.Log(itemList);
        foreach(ItemCategory cat in itemList.type)
        {
            foreach(ItemBase b in cat.id)
            {
                Debug.Log(b.ToString());
            }
        }

passwords – “john –format=md5” caused “Unknown ciphertext format name requested” error

Linux unshadow file

wolf@linux:~$ cat md5hash.txt 
root:$1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.:0:0:root:/root:/bin/bash
john:$1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1:500:500::/home/john:/bin/bash
harold:$1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1:501:501::/home/harold:/bin/bash
wolf@linux:~$ 

md5hash only

wolf@linux:~$ cat md5hash_only.txt 
$1$FTpMLT88$VdzDQTTcksukSKMLRSVlc.
$1$wk7kHI5I$2kNTw6ncQQCecJ.5b8xTL1
$1$7d.sVxgm$3MYWsHDv0F/LP.mjL9lp/1
wolf@linux:~$ 

Since I know that these are md5 format, I used --format=md5 option in john.

Unfortunately, I’m getting Unknown ciphertext format name requested error.

wolf@linux:~$ john --format=md5 md5hash.txt 
Unknown ciphertext format name requested
wolf@linux:~$ 

wolf@linux:~$ john --format=md5 md5hash_only.txt 
Unknown ciphertext format name requested
wolf@linux:~$ 

I’ve verified that the format is similar with pentestmonkey cheat-sheet

Any idea what’s wrong here?

How can I copy code from Thonny, and paste into Word keeping the format?

I keep seeing the “Copy RTF” thing under plugins for everyone and it seems to work, but im using Thonny and can’t figure out how to copy my code and paste it into a word document keeping the same formatting. I have python 3.7.7

Is it possible to recover data from a Western Digital TRIM supporting disks (not SSD) after quick format?

I have a western digital blue disk, which is one of the SMR variations. I’ve heard that they support TRIM command. The disk is accidentally quick formatted on Windows 10, and now seems to be all zero. But, I’m wondering, for a disk it would take illogical amount of effort to actually set all sectors (1TB) to zero. I don’t really understood how TRIM applies to such disks, and suppose to see something like a list of safely deletable sectors or something like that in the disk’s firmware.

So the question is: Is there any way to recover the data from my disk? Including firmware tweaks or hardware tweaks?

8 – Programmatically set the format for each value of a multi-value text field

I am trying to programmatically set the format of a multi value text field to ‘full_html’.

I have tried:

$Links = array (1, 2, 3, 4, 5);

$node->field_article_links() = $Links;
$node->field_article_links->format = 'full_html';
$node->save();

and

$Links = array (1, 2, 3, 4, 5);

foreach ($Links as $Link) {
$node->set('field_article_links', $Link);
$node->field_article_links->format = 'full_html';
}
$node->save();

But the results are always the same, only the format of the first value of the field is set to ‘full_html’ and the others remain unchanged.

node edit

What am i doing wrong ?

magento 1.9 – Magento1 format string to date

I want format from string to date. How can i do?

public function checkTimeCourse(){

    $modelCoure = Mage::getModel('course/courses')->getCollection();
    $modelCoure->getSelect();
    $toDay = date('Y-m-d');echo $toDay; //2020-05-19
    foreach($modelCoure as $item){
        $dateTo = date($item->getDateTo()); // select from database string(2020-05-25)
        $checkDay = $toDay - $dateTo;
        var_dump($dateTo);
    }exit();

Help me please!

python – Python3 printing on the same line – Numbers in 7-segment device format

I am new to Python and am having trouble printing the output on one line.

This relates to the Python Learning Python Essentials Lab 5.1.10.6 online class and printing to a 7-segment device. If you're not familiar with a 7-segment device, check out Wikipedia.

I do not use any external device. I only need it to print on my own terminal. All the other StackOverflow solutions that I have found are related to the use of real devices and have not helped.

  • Laboratory link:
    https://edube.org/learn/programming-essentials-in-python-part-2/lab-a-led-display

  • Purpose: To request a number from the user; print number on 7-segment display
    format to your terminal.

  • Notes: Usage Python 3.9. I have tried 3 alternative solutions (Option 1,2,3), but none do what I want.
  • INSTRUCTIONS: One / How Option 1, 2 or 3 to execute only this option
  • I found this alternative solution, which I mainly understand and which achieves what I am trying to accomplish. However, this is a totally different approach and not the one I would have imagined. I know there are many ways to dress up a 7-segment device, and if that is the most correct, then I will learn it. But I feel like I'm so close and only superfluous 'n' far from finding out with my own method and i'm just trying to figure out what i'm missing.

Thank you for your help.

Desired output

###   ##  ###  ###  # #  ###  ###  ###  ###  ###  
# #  ###    #    #  # #  #    #      #  # #  # #  
# #   ##  ###  ###  ###  ###  ###    #  ###  ###  
# #   ##  #      #    #    #  # #    #  # #    #  
###   ##  ###  ###    #  ###  ###    #  ###  ###

My code

# clear screen each time you run the script
import os
clear = lambda: os.system('cls')
clear()
# 
# Dictionary of (number:7-segment-hash)
dict1 = {
    '0':('###','# #','# #','# #','###'),
    '1':('#####'),
    '2':('###',"https://serverfault.com/#",'###',"https://serverfault.com/#",'###'),
    '3':('###',"https://serverfault.com/#",'###',"https://serverfault.com/#",'###'),
    '4':('# #','# #','###',"https://serverfault.com/#","https://serverfault.com/#"),
    '5':('###',"https://serverfault.com/#",'###',"https://serverfault.com/#",'###'),
    '6':('###',"https://serverfault.com/#",'###','# #','###'),
    '7':('###',"https://serverfault.com/#","https://serverfault.com/#","https://serverfault.com/#","https://serverfault.com/#"),
    '8':('###','# #','###','# #','###'),
    '9':('###','# #','###',"https://serverfault.com/#",'###')
}

# Function to print numbers in 7-segment-device format
def fun_PrintNums(num):
    if num < 0 or num % 1 > 0 or type(num)!=int:    # if num is NOT a positive whole integer
        return "Invalid entry, please try again"
    else: 
        display = ''
        for i in str(num):      # convert 'num' to STRING; for each "number" in string 'num"https://serverfault.com/#"''Option 1: works, but prints nums vertically instead of side-by-side; Return=None ''' #
            for char in dict1(i):
                print(*char)
print(fun_PrintNums(int(input("Enter any string of whole numbers: "))))
#----------------------------------------------------------------#


#''' Option 2: Return works, but still vertical and not spaced out ''' #
#             for char in dict1(i):
#                 display.append(char)
#     return display
# print('n'.join(fun_PrintNums(int(input("Enter any string of whole numbers: ")))))
#---------------------------------------------------------------------#

#''' Option 3: 'display' row1 offset; spaced out as desired, but vertical; Return=None''' #
#             for char in dict1(i):                
#                 display += char
#                 display += 'n'
#     a = print(*display,end='')
#     return a
# print(fun_PrintNums(int(input("Enter any string of whole numbers: "))))
#---------------------------------------------------------------#

Option 1 Exit
Works, but prints nums vertically instead of side by side; Return = None

# # #
    #
# # #
#    
# # #
# # #
    #
# # #
    #
# # #
None 

Option 2 Exit
Return works, but always vertical and not spaced


###
  #
###
#  
###
###
  #
###
  #
###

Option 3 Exit
& # 39; display & # 39; offset row1; spaced as desired, but vertical; Return = None

  # # # 
     #  
 # # #  
 #      
 # # #  
 # # #  
     #  
 # # #  
     #  
 # # #  
None  

My photos are saved in pp3 format after saving them in a raw therapist

when i edit my photo and save it in the app it saves as pp3 file and i can't figure out how to change that. I have looked for other applications to open the file, but I have not found a single one.