cell2net.preprocessing.random_seq#
- cell2net.preprocessing.random_seq(seq_len, bases=None)#
Generate a random nucleotide sequence of a specified length.
This function creates a random sequence of nucleotides (or other bases) by selecting characters from a provided list of bases. If no base list is provided, the default bases are adenine (A), cytosine (C), guanine (G), and thymine (T).
- Parameters:
- Return type:
- Returns:
str A randomly generated sequence of the specified length using the provided bases.
Examples
>>> random_seq(10) 'ACGTGCTAGC' >>> random_seq(5, bases=["A", "T"]) 'TATTA'