Index Generator API¶
API operations on pools.
-
class
index_generator.views.GeneratorIndexTypeViewSet(**kwargs)[source]¶ Bases:
index_generator.views.MoveOtherMixin,rest_framework.viewsets.ReadOnlyModelViewSetGet the list of index types.
-
queryset¶
-
serializer_class¶ alias of
IndexTypeSerializer
-
-
class
index_generator.views.IndexGeneratorViewSet(**kwargs)[source]¶ Bases:
rest_framework.viewsets.ViewSet,common.mixins.LibrarySampleMultiEditMixin-
library_model¶ alias of
Library
-
library_serializer¶ alias of
IndexGeneratorLibrarySerializer
-
permission_classes= [<class 'rest_framework.permissions.IsAdminUser'>]¶
-
sample_model¶ alias of
Sample
-
sample_serializer¶ alias of
IndexGeneratorSampleSerializer
-
-
class
index_generator.views.MoveOtherMixin[source]¶ Bases:
objectMove the Other option to the end of the returning list.
-
class
index_generator.views.PoolSizeViewSet(**kwargs)[source]¶ Bases:
rest_framework.viewsets.ReadOnlyModelViewSetGet the list of pool sizes.
-
queryset¶
-
serializer_class¶ alias of
PoolSizeSerializer
-
-
class
index_generator.index_generator.IndexRegistry(mode, index_types, start_coord='A1', direction='right')[source]¶ Bases:
objectClass for storing fetched and sorted indices i7/i5 and index pairs.
-
static
create_index_dict(format='', index_type='', read_type='', prefix='', number='', index='', coordinate='', is_library=False)[source]¶
-
fetch_pairs(index_type, char_coord, num_coord, direction)[source]¶ Fetch index pairs (Index i7 + Index i5) for a given index type, start coordinate, and direction.
-
get_indices(index_type_id, index_group)[source]¶ Return a list of indices for a given index type id and index group.
-
static
-
class
index_generator.index_generator.IndexGenerator(library_ids, sample_ids, start_coord, direction)[source]¶ Bases:
objectMain class that fetches provided libraries and samples, checks the compatibility of their index types, generates indices, and assigns them to the libraries and samples.
-
MAX_ATTEMPTS= 30¶
-
MAX_RANDOM_SAMPLES= 5¶
-
calculate_scores(current_sample, current_converted_index, current_color_distribution, total_depth)[source]¶ Calculate the scores for a given sample.
Score is an absolute difference between the sequencing depths of the two indices divided by the total sequencing depth (in %).
The ideal score is 0.0 (50% green and 50% red), an acceptable score is 60.0 (80%/20% or 20%/80%).
If the score > 60%, then the indices are not compatible.
-
find_index(sample, index_group, current_indices, depths)[source]¶ Helper function for find_indices().
-
find_indices(samples, depths, index_group, init_indices)[source]¶ Generate indices for given samples and index group (I7/I5).
-
find_pairs_fixed(plate_samples, init_index_pairs)[source]¶ Return subsequent index pairs from the Index Registry starting from the first one.
-
format= ''¶
-
index_length= 0¶
-
index_registry= None¶
-
libraries= None¶
-
mode= ''¶
-
num_libraries= 0¶
-
num_samples= 0¶
-
result¶ Construct a list of all records and their indices.
-
samples= None¶
-