At the moment I use this way to resolve my question:
re.findall(r'(\w+):\W(\d+)',str(tp[0]))
However please gave me you suggestion on how to improve my ability to use
regular expression on python
Thanks so much!
___
Tutor maillist - Tutor@python.o
Dear all.
I would like to extract from some file some data.
The line I'm interested is this:
Input Read Pairs: 2127436 Both Surviving: 1795091 (84.38%) Forward Only
Surviving: 17315 (0.81%) Reverse Only Surviving: 6413 (0.30%) Dropped: 308617
(14.51%)
with open("255.trim.log","r") as p:
I create a list of local object: but I can't execute as object only as string:
ena = Rnaseq(options.configura, options.rst)
job_1 = ena.trimmomatic()
job_2 = ena.star()
job_3 = ena.wiggle()
job_4 = ena.rnaseqc()
job_5 = ena.picard_sort_sam()
dear all,
thanks so much!! I explain better my problem :http://pastebin.com/iiPZMi2U
this is my workflow. Take my data from readset an create a command list
ena = Rnaseq()
The order of the self.step are the order I wan to to execute my analisys.
So this is the order:
In [160]: ena.show()
1- tr
Thanks so much!! Now I understood it is a stupid thing!
So, could you elpme to decompose the problem?
I initiazlizate the class with the file to use so all the function have all
the parameters that I need.
At the moment I have in mind only to do this:
ena = Rna()
job1 = ena.trim()
job2 = ena.alig
Dear All,
What is the best way to loop on methos on a class?
class Rna():
def trim():
...
def align():
...
ena = Rna()
ena.trim()
ena.aling()
Thanks for any suggestion!!!
___
Tutor maillist - Tutor@python.org
To unsubscri
Thanks so much for clear explanation!!! So in this way work .
In [38]: Test().x.__name__
Out[38]: 'x'
The decoratory proprerty dosen't help to create the class in fast way.. When
it is advisable use @property?
___
Tutor maillist - Tutor@python.org
T
/2015 11.08
>A: "jarod...@libero.it"
>Cc: "Python Tutor Mailing List"
>Ogg: Re: Re: [Tutor] Class learning
>
>On Fri, Jan 23, 2015 at 12:37 AM, jarod...@libero.it
wrote:
>> Thanks for the help and patience!
>> It is a function on the class so I suppos
Thanks for the help and patience!
It is a function on the class so I suppose for read that function list I need
self.steps Where I'm wrong?
@propertydef steps(self):return [
self.trimmomatic,
self.merg
Dear All
How can gave the attributes __name__ to a function?
class Foo(object):
def __init__(self):
steps = {}
tmp = open("rnaseq.base.ini","rb")
config.readfp(tmp)
readsets =
parse_illumina_readset_file("/home/mauro/Desktop/readset.csv")
@prop
Dear All,
I created a class that invoke from another file another class
I get an error that I do not understand: gobal name Job is not defined
However If I see the class imported I found the class Job.
Any suggestion or example on class invoke another class
#job,py
class Jobs:
.
#trial
>I'd also question why you seem to have a function that has the class
>name in its name? Should that function not be a method of the class?
>Or is it part of some third party library perhaps?
Thanks for the clarification!! Could you please make an example of this two
condition I still try to devo
Dear all, I continue to try to understand some code:
class Tutto():
def __init__(self):
print "Ok"
#@property
def readsets(self,nome):
self.nome = nome
self._readsets = parse_tutto_readset_file(self.nome)
return self._readsets
Why If uncomment the decora
Dear All,
I would like to understand how work this funcion:
def parse_illumina_readset_file(illumina_readset_file):
readsets = []
samples = []
log.info("Parse readset " + illumina_readset_file + " ...")
readset_csv = csv.DictReader(open(illumina_readset_file, 'rb'),
delimiter='\t
thanks so much,here you have the error:
---
NameError Traceback (most recent call last)
in ()
43 status = line[-4:] #
and overall status pas
Dear all
I aattach the file I want to parse and I wanto to create a sqlite database.
The problem is I'm not able to create in the right way because there is some
logic problems on my script. I have this code:
import sqlite
import sqlite3
import os
# Creates or opens a file called mydb with a S
Dear All thanks so much for the suggestion !!!
One thing is not clear to me: How can write more safe string to send on
subprocess.Popen() without %s? What is the best way to do this?
thanks so much!
___
Tutor maillist - Tutor@python.org
To unsubscr
Dear All,
I need to use external program from my scirpt.
code = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f
4,8|uniq > tmp.tmp1"%("gene5.tmp.bed")
code2 = "intersectBed -a %s -b /database/Refseq_Gene2.bed -wa -wb|cut -f
4,8|uniq > tmp.tmp2"%("gene3.tmp.bed")
proc =
;than "Re: Contents of Tutor digest..."
>
>
>Today's Topics:
>
> 1. Re: Would somebody kindly... (Steven D'Aprano)
> 2. Re: Would somebody kindly... (Dave Angel)
> 3. question on array Operation (jarod...@libero.it)
> 4. Re: question on array
Dear All,
I have a long matrix where I have the samples (1to n) and then I have (1to j
)elements.
I would like to count how many times each j element are present on each
samples.
So the question is which is the best algoritm for obtain the results. The
result I want is a table like that.
A
Dear All,
or improve my understanding o python I would like to learn how to draw simple
figures using loops.
I start from this code in java:
import java.util.Scanner;
public class Eserc2_8 {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
// Altezz
Hi there!!
I need to read this file:
pippo.count :
10566 ZXDC
2900 ZYG11A
7909 ZYG11B
3584 ZYX
9614 ZZEF1
17704 ZZZ3
This file present a use space on the begin then they have a number and the a
word.
p =re.compile("\s+\d+")
with open("pippo.count") as p:
for i in p:
Thanks for the suggestion and corrections.
I don't put the else staement onf if log_file but now I realize my mistake
I have 3 comand to do:
step_1_out =["STAR --genomeDir /home/sbsuser/databases/Starhg19/GenomeDir/ --
runMode alignReads --readFilesIn %s %s --runThreadN 12 --readFilesCommand
z
thon.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Tutor digest..."
>
>
>Today's Topics:
>
> 1. Re: Good approach regarding classes attribute
e, Sep 9, 2014 at 9:09 AM, Sydney Shall wrote:
>
>> And while I am writing, what does OP stand for in this list?
>
>"Original Poster". So I understand. Won't answer the Python question
>since I'm a newbie here myself.
>
>--
>Mind on a Mis
Dear all!!
I want to use subprocess for run some programs But I need to be sure the
program end before continue with the other:
subprocess.call("ls")
cmd1 = i
p1 = subprocess.Popen(cmd1,shell=True,stdout=subprocess.PIPE)
while True:
if p1.poll() is None:
time.sleep(3)
pass
if p1.poll()==0:
print
>Messaggio originale
>Da: jarod...@libero.it
>Data: 08/09/2014 18.15
>A:
>Ogg: how to be sure the process are ended
>
>Dear all!!
>I want to use subprocess for run some programs But I need to be sure the
>program end before continue with the ot
Dear all,
I'll try to write a pipeline starting from a csv file where I write the name
and the path of my files.
example.csv
Name,FASTQ1,FASTQ2,DIRECTORY
sampleA,A_R1_.fastq.gz,A_R2_.fastq.gz,108,~/FASTQ/
sampleB,B_R1_.fastq.gz,B_R2_.fastq.gz,112,~/FASTQ/
On that list I need to send each time 3
your Subject line so it is more specific
>than "Re: Contents of Tutor digest..."
>
>
>Today's Topics:
>
> 1. How to show dictionary item non present on file
> (jarod...@libero.it)
> 2. Re: How to show dictionary item non present on file
> (
Hin there!!!
I have a niave question on dictionary analysis:
If you have a dictionary like this:
diz
Out[8]: {'elenour': 1, 'frank': 1, 'jack': 1, 'ralph': 1}
and you have a list and you want to know which keys are not present on my
dictionary the code are simple.
for i in diz.keys():
...:
Hi there!!!
I have a file with this data
['uc002uvo.3 ', 'uc001mae.1']
['uc010dya.2 ', 'uc001kko.2']
['uc003ejx.2 ', 'uc010yfr.1']
['uc001bhk.2 ', 'uc003eib.2']
['uc001znc.2 ', 'uc001efn.2']
['uc002ycq.2 ', 'uc001vnh.2']
['uc001odf.1 ', 'uc002mwd.2']
['uc010jkn.1 ', 'uc010luk.1']
['uc003uhf.3 ', '
Dear all thanks for your suggestion!!!
Thanks to your suggestion I create this structure:with open("prova.csv") as p:
for i in p:
lines =i.rstrip("\n").split("\t")
...: print lines
...:
['programs ', 'sample', 'gene', 'values']
['program1', 'sample1', 'TP53', '2']
HI there!!!
I have afile like this:
file.txt
programssample gene
program1sample1 TP53
program1sample1 TP53
program1sample2 PRNP
program1sample2 ATF3
program2sample1 TP53
program2sample1 PRNP
program2sample2 TRIM32
program2sam
Dear all!
I have two example files:
tmp.csv:
namevalue root
mark34 yes
tmp2.csv
namevalue root
I want to print a different text if I have more than one row and if I have
only one row. My code is this:
with open("tmp.csv") as p:
header =p.next()
for i in p:
p
reach the person managing the list at
> tutor-ow...@python.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Tutor digest..."
>
>
>Today's Topics:
>
> 1. Help on best way to check resence of item inside l
Dear All
clubA= ["mary","luke","amyr","marco","franco","lucia", "sally","genevra","
electra"]
clubB= ["mary","rebecca","jane","jessica","judit","sharon","lucia", "sally","
Castiel","Sam"]
I have a list of names that I would to annotate in function of presence in
different clubs:
my input files
Hi I want to merge many files like this:
#file1
A 10
B 20
C 30
#file2
B 45
Z 10
#file1
A 60
B 70
C 10
I want to obtain
A 10 0 60
B 20 45 70
C 30 0 10
Z 0 10 0
I try to do like this:
f = os.listdir(".")
for i in f:
T =open(i,"r")
for r in t.readli
HI there!!!
I have a file like this:
12345-2 ppp
12389-4
i
...
I want to read this file and organize in different way: The second number
present after "-" mea
38 matches
Mail list logo