This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of how to run: tar -xJOf sequences_fasta_2024_04_25.tar.xz sequences.fasta | python translate.py | pv -l | zstd > seqs.fa.zst | |
import sys | |
import tarfile | |
import pandas as pd | |
def load_virus_to_accession_dict(tar_path): | |
""" Load the virus to accession ID dictionary from a tar.xz file containing a .tsv. """ | |
with tarfile.open(tar_path, 'r:xz') as tar: | |
# Find the tsv file within the archive, assuming there's only one .tsv | |
tsv_file = [member for member in tar.getmembers() if member.name.endswith('.tsv')][0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOCUS MN908947 29903 bp ss-RNA linear VRL 18-MAR-2020 | |
DEFINITION Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, | |
complete genome. | |
ACCESSION MN908947 | |
VERSION MN908947.3 | |
KEYWORDS . | |
SOURCE Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) | |
ORGANISM Severe acute respiratory syndrome coronavirus 2 | |
Viruses; Riboviria; Orthornavirae; Pisuviricota; Pisoniviricetes; | |
Nidovirales; Cornidovirineae; Coronaviridae; Orthocoronavirinae; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/Desktop/hCoV-19_msa_1125.tar.xz | xz -dT10 | tar -xJO msa_1125/msa_1125.fasta | pv -c | zstd -c > msa.fa.zst | |
cat ~/Desktop/metadata_tsv_2023_12_18.tar.xz | xz -dT10 | tar -xJO metadata.tsv | pv -c | zstd -c > metadata.tsv.zst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
mutations_in_highly_mutated_seq = "A543G, G1068A, G1186A, G1264A, T1370C, G1743A, A2497G, C2583T, T2824C, G3287A, C3393T, A3430G, C3604T, G3794A, A4179G, G4300A, G4352A, G4444A, G4474A, A4501G, G4975A, T5117C, G5230A, G5720A, G5861A, C6031T, G6123A, C6198T, G6362A, A6565G, T6661C, G6759A, A6833G, C7051T, C7086T, T7114C, A7558G, C7749T, A7795G, G7934A, C8169T, T8779C, T8875C, T9148C, G9209A, A9409G, C9438T, C9521T, G9575A, A9984G, C10015T, G11198A, C11199T, G11330A, G11605A, T11701C, G11837A, G11944A, A12030G, A12271G, G12442A, C12540T, C12633T, T12703C, C13818T, C14216T, G14622A, C15026T, C15656T, C15783T, C16767T, G16861A, C17481T, T17505C, A17993G, C18201T, C18888T, A19574G, G20062A, T20502C, C21297T, C21588T, G21668A, A21717G, T21752C, A21996G, A22101G, T22189C, T22254C, G22770A, C22783T, A22893G, A23004G, C23013T, G23048A, T23425C, A23734G, T23948C, A24003G, A24062G, C24961T, G24977A, C25066T, G25537A, T25779C, C25872T, C26176T, C26195T, C26335T, G26428A, C26645T, T26819G, G27014A, A27146G, A27386 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastapi import FastAPI, WebSocket | |
import openai | |
import time | |
import json | |
import asyncio | |
import os | |
#get the api key from the environment variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are LabGPT. You are in charge of conducting scientific experiments to achieve a stated goal. You have access to an OpenTrons OT2 robot and a lab helper | |
You have access to the following commands: | |
Request: enter a request to a user. you can use this for example to get them to set some labware up inside the robot in desired positions. | |
ExecuteRobotCommands: runs a Python script written in the OT2 API. This will be executed immediately using the Jupyter-notebook style implementation on the robot. State is maintained between calls to this. | |
The first time, set up like this: | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
library(tidyverse) | |
library(gganimate) | |
library(tweenr) | |
# Read in the CSV file | |
df <- read_csv("~/Downloads/ambulance.csv", col_names = c("date","minutes")) | |
df$difftime = as.difftime(df$minutes, units = 'mins') | |
p<-ggplot(df,aes(x=date,y=difftime))+geom_line(color="#142bdb") +coord_cartesian(ylim=c(0,NA)) + geom_hline(yintercept=18,linetype=2,color="#666666") +theme_bw() +scale_y_time(labels = function(l) strftime(l, '%M:%S')) +labs(x="Date",y="Response time\n(hours:minutes)", |
NewerOlder