pydna.myprimers

Provides a practical way to access a list of primer sequences in a text file.

The path of a text file can be specified in the pydna.ini file or by the ´pydna_primers´ environment variable.

The file is expected to contain sequences in FASTA, Genbank or EMBL formats or any format readable by the parse_primers function.

The primer list is expected to follow the convension below. The primer name is expected to begin with the number.

can have the format below for example:

>2_third_primer
tgagtagtcgtagtcgtcgtat

>1_second_primer
tgatcgtcatgctgactatactat

>0_first_primer
ctaggatcgtagatctagctg
...

The primerlist funtion returns a list of pydna.primer.Primer objects primerdict returns a dict where the key is the id of the object.

class pydna.myprimers.PrimerList(initlist: ~typing.Iterable = None, path: (<class 'str'>, <class 'pathlib.Path'>) = None, *args, identifier: str = "p", **kwargs)[source]

Bases: UserList

Read a text file with primers.

The primers can be of any format readable by the parse_primers function. Lines beginning with # are ignored. Path defaults to the path given by the pydna_primers environment variable.

The primer list does not accept new primers. Use the assign_numbers_to_new_primers method and paste the new primers at the top of the list.

The primer list remembers the numbers of accessed primers. The indices of accessed primers are stored in the .accessed property.

property accessed

docstring.

assign_numbers(lst: list)[source]

Find new primers in lst.

Returns a string containing new primers with their assigned numbers. This string can be copied and pasted to the primer text file.

pydna_code_from_list(lst: list)[source]

Pydna code for a list of primer objects.

open_folder()[source]

Open folder where primer file is located.

code(lst: list)

Pydna code for a list of primer objects.

pydna.myprimers.check_primer_numbers(pl: list = None)[source]

Find primers whose number do not match position in list.

pydna.myprimers.undefined_sequence(pl: list = None)[source]

Primers in list with N or n instead of a sequence.

pydna.myprimers.find_duplicate_primers(pl: list = None)[source]

Find a list of lists with duplicated primer sequences.