小编dav*_*vid的帖子

为情节图例添加标题

在下面的示例中,如何在plot_ly中为R添加标题?

mtcars %>%   plot_ly(x = ~disp, y = ~mpg, color = ~factor(cyl), size = ~wt) %>%   add_markers(
    hoverinfo = "text",
    text = ~paste("Displacement = ", disp, "\nMiles Per Gallon = ", mpg)   ) %>%   layout(title ="Custom Hover Text")
Run Code Online (Sandbox Code Playgroud)

谢谢

plot r plotly

6
推荐指数
2
解决办法
4236
查看次数

快速替换data.table中的字符串

给出下表

df <- structure(list(V1 = c("Prodigal_2|LOCUS_00010", "Prodigal_2|LOCUS_00010", 
"Prodigal_2|LOCUS_00010", "Prodigal_2|LOCUS_00010", "Prodigal_2|LOCUS_00010", 
"Prodigal_2|LOCUS_00010"), V2 = c("WP_001212884.1", "WP_042596810.1", 
"WP_131250681.1", "WP_001212880.1", "WP_016079538.1", "WP_086396124.1"
), V3 = c(100, 99.7, 99.7, 99.7, 99.7, 99.7), V4 = c(381L, 381L, 
381L, 381L, 381L, 381L), V5 = c(0L, 1L, 1L, 1L, 1L, 1L), V6 = c(0L, 
0L, 0L, 0L, 0L, 0L), V7 = c(1L, 1L, 1L, 1L, 1L, 1L), V8 = c(381L, 
381L, 381L, 381L, 381L, 381L), V9 = c(1L, 1L, 1L, 1L, 1L, 1L), 
    V10 = c(381L, 381L, …
Run Code Online (Sandbox Code Playgroud)

r data.table stringi

2
推荐指数
1
解决办法
4369
查看次数

摆脱输出中的括号

我认为这对你来说是一个简单的问题,因为我是python3的初学者.打印fasta文件的标题时,它包含括号.我怎么能删除它们?

import sys
from Bio import Entrez
from Bio import SeqIO


#define email for entrez login
db           = "nuccore"
Entrez.email = "someone@email.com"

#load accessions from arguments
if len(sys.argv[1:]) > 1:
  accs = sys.argv[1:]
else: #load accesions from stdin  
  accs = [ l.strip() for l in sys.stdin if l.strip() ]
#fetch
sys.stderr.write( "Fetching %s entries from GenBank: %s\n" % (len(accs), ", ".join(accs[:10])))
for i,acc in enumerate(accs):
  try:
    sys.stderr.write( " %9i %s          \r" % (i+1,acc))  
    handle = Entrez.efetch(db=db, rettype="fasta", id=acc)
    seq_record = …
Run Code Online (Sandbox Code Playgroud)

python bioinformatics biopython python-3.x

1
推荐指数
1
解决办法
443
查看次数

标签 统计

r ×2

bioinformatics ×1

biopython ×1

data.table ×1

plot ×1

plotly ×1

python ×1

python-3.x ×1

stringi ×1