Example #1
0
                        #pkUsed = dnaAnnot.pk
                        pkUsed = lastComponentDisplayID + 1
                        stringId = '00000000'+str(pkUsed)                                
                        stringId = stringId[-3:]
                        dnaAnnot.displayId = 'Ve'+stringId
                        dnaAnnot.save()
                    else:
                        lastComponent = DnaComponent.objects.filter(displayId__regex='^gb.*').order_by('-displayId')[:1]
                        leng = len(lastComponent)
                        if leng>0:
                            lastComponentDisplayID = int(lastComponent[0].displayId[2:])
                        else:
                            lastComponentDisplayID = 0  
                        pkUsed = lastComponentDisplayID + 1    
                        stringId = '00000000'+str(pkUsed)                                
                        stringId = stringId[-4:]
                        dnaAnnot.displayId = 'gb'+stringId
                        dnaAnnot.save()                                
                dnaAnnot.componentType = subCtVectorType
                dnaAnnot.save()
                stra = utilLabrack.getStrand(fullSequence,dnaAnnot.sequence)
               
                an2db = DnaSequenceAnnotation(uri ='', bioStart = first, bioEnd = secon, strand = stra, subComponent = instance, componentAnnotated = dnaAnnot)
                an2db.save()
               
        print '+ end selectedAnnotFromGB'
        
        return instance

    class Meta:
        model = DnaComponent  
Example #2
0
                    else:
                        lastComponent = DnaComponent.objects.filter(
                            displayId__regex='^gb.*').order_by(
                                '-displayId')[:1]
                        leng = len(lastComponent)
                        if leng > 0:
                            lastComponentDisplayID = int(
                                lastComponent[0].displayId[2:])
                        else:
                            lastComponentDisplayID = 0
                        pkUsed = lastComponentDisplayID + 1
                        stringId = '00000000' + str(pkUsed)
                        stringId = stringId[-4:]
                        dnaAnnot.displayId = 'gb' + stringId
                        dnaAnnot.save()
                dnaAnnot.componentType = subCtVectorType
                dnaAnnot.save()
                stra = utilLabrack.getStrand(fullSequence, dnaAnnot.sequence)

                an2db = DnaSequenceAnnotation(uri='',
                                              bioStart=first,
                                              bioEnd=secon,
                                              strand=stra,
                                              subComponent=instance,
                                              componentAnnotated=dnaAnnot)
                an2db.save()

        print '+ end selectedAnnotFromGB'

        return instance